Makefile 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. ETCDIR=${DESTDIR}/etc
  2. LIBDIR=${DESTDIR}/lib
  3. SERVICEDIR=${LIBDIR}/services
  4. UNITDIR=${LIBDIR}/systemd/system
  5. MAN8=${DESTDIR}/usr/share/man/man8
  6. SBIN=${DESTDIR}/sbin
  7. MODE=754
  8. DIRMODE=755
  9. CONFMODE=644
  10. all: links
  11. install: all
  12. create-dirs:
  13. install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc0.d
  14. install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc1.d
  15. install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc2.d
  16. install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc3.d
  17. install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc4.d
  18. install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc5.d
  19. install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc6.d
  20. install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rcS.d
  21. install -d -m ${DIRMODE} ${ETCDIR}/rc.d/init.d
  22. install -d -m ${DIRMODE} ${ETCDIR}/sysconfig
  23. install -d -m ${DIRMODE} ${LIBDIR}
  24. install -d -m ${DIRMODE} ${SERVICEDIR}
  25. install -d -m ${DIRMODE} ${UNITDIR}
  26. install -d -m ${DIRMODE} ${MAN8}
  27. install -d -m ${DIRMODE} ${SBIN}
  28. ln -sfn services ${LIBDIR}/lsb
  29. ln -sfn rc.d/init.d ${ETCDIR}/init.d-sysv
  30. ln -sfn init.d-sysv ${ETCDIR}/init.d
  31. files: create-dirs
  32. install -m ${MODE} lfs/init.d/checkfs ${ETCDIR}/rc.d/init.d/
  33. install -m ${MODE} lfs/init.d/cleanfs ${ETCDIR}/rc.d/init.d/
  34. install -m ${MODE} lfs/init.d/halt ${ETCDIR}/rc.d/init.d/
  35. install -m ${MODE} lfs/init.d/console ${ETCDIR}/rc.d/init.d/
  36. install -m ${MODE} lfs/init.d/localnet ${ETCDIR}/rc.d/init.d/
  37. install -m ${MODE} lfs/init.d/modules ${ETCDIR}/rc.d/init.d/
  38. install -m ${MODE} lfs/init.d/mountfs ${ETCDIR}/rc.d/init.d/
  39. install -m ${MODE} lfs/init.d/mountvirtfs ${ETCDIR}/rc.d/init.d/
  40. install -m ${MODE} lfs/init.d/network ${ETCDIR}/rc.d/init.d/
  41. install -m ${MODE} lfs/init.d/rc ${ETCDIR}/rc.d/init.d/
  42. install -m ${MODE} lfs/init.d/reboot ${ETCDIR}/rc.d/init.d/
  43. install -m ${MODE} lfs/init.d/sendsignals ${ETCDIR}/rc.d/init.d/
  44. install -m ${MODE} lfs/init.d/setclock ${ETCDIR}/rc.d/init.d/
  45. install -m ${MODE} lfs/init.d/swap ${ETCDIR}/rc.d/init.d/
  46. install -m ${MODE} lfs/init.d/sysctl ${ETCDIR}/rc.d/init.d/
  47. install -m ${MODE} lfs/init.d/sysklogd ${ETCDIR}/rc.d/init.d/
  48. install -m ${MODE} lfs/init.d/template ${ETCDIR}/rc.d/init.d/
  49. install -m ${MODE} lfs/init.d/udev ${ETCDIR}/rc.d/init.d/
  50. install -m ${MODE} lfs/init.d/udev_retry ${ETCDIR}/rc.d/init.d/
  51. install -m ${MODE} lfs/sbin/ifup ${SBIN}
  52. install -m ${MODE} lfs/sbin/ifdown ${SBIN}
  53. install -m ${CONFMODE} lfs/sbin/ifup.8 ${MAN8}
  54. ln -sf ifup.8 ${MAN8}/ifdown.8
  55. install -m ${MODE} lfs/lib/services/ipv4-static-route ${SERVICEDIR}
  56. install -m ${MODE} lfs/lib/services/ipv4-static ${SERVICEDIR}
  57. install -m ${CONFMODE} lfs/lib/services/init-functions ${SERVICEDIR}
  58. install -m ${CONFMODE} lfs/units/ifupdownat.service ${UNITDIR}/ifupdown@.service
  59. if [ ! -f ${ETCDIR}/sysconfig/createfiles ]; then \
  60. install -m ${CONFMODE} lfs/sysconfig/createfiles ${ETCDIR}/sysconfig/ ;\
  61. fi
  62. if [ ! -f ${ETCDIR}/sysconfig/modules ]; then \
  63. install -m ${CONFMODE} lfs/sysconfig/modules ${ETCDIR}/sysconfig/ ;\
  64. fi
  65. if [ ! -f ${ETCDIR}/sysconfig/udev_retry ]; then \
  66. install -m ${CONFMODE} lfs/sysconfig/udev_retry ${ETCDIR}/sysconfig/ ;\
  67. fi
  68. if [ ! -f ${ETCDIR}/sysconfig/rc.site ]; then \
  69. install -m ${CONFMODE} lfs/sysconfig/rc.site ${ETCDIR}/sysconfig/ ;\
  70. fi
  71. links: rcS rc0 rc1 rc2 rc3 rc4 rc5 rc6
  72. rcS: files
  73. ln -sf ../init.d/mountvirtfs ${ETCDIR}/rc.d/rcS.d/S00mountvirtfs
  74. ln -sf ../init.d/modules ${ETCDIR}/rc.d/rcS.d/S05modules
  75. ln -sf ../init.d/localnet ${ETCDIR}/rc.d/rcS.d/S08localnet
  76. ln -sf ../init.d/udev ${ETCDIR}/rc.d/rcS.d/S10udev
  77. ln -sf ../init.d/swap ${ETCDIR}/rc.d/rcS.d/S20swap
  78. ln -sf ../init.d/checkfs ${ETCDIR}/rc.d/rcS.d/S30checkfs
  79. ln -sf ../init.d/mountfs ${ETCDIR}/rc.d/rcS.d/S40mountfs
  80. ln -sf ../init.d/cleanfs ${ETCDIR}/rc.d/rcS.d/S45cleanfs
  81. ln -sf ../init.d/udev_retry ${ETCDIR}/rc.d/rcS.d/S50udev_retry
  82. ln -sf ../init.d/console ${ETCDIR}/rc.d/rcS.d/S70console
  83. ln -sf ../init.d/sysctl ${ETCDIR}/rc.d/rcS.d/S90sysctl
  84. rc0: files
  85. ln -sf ../init.d/network ${ETCDIR}/rc.d/rc0.d/K80network
  86. ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc0.d/K90sysklogd
  87. ln -sf ../init.d/sendsignals ${ETCDIR}/rc.d/rc0.d/S60sendsignals
  88. ln -sf ../init.d/swap ${ETCDIR}/rc.d/rc0.d/S65swap
  89. ln -sf ../init.d/mountfs ${ETCDIR}/rc.d/rc0.d/S70mountfs
  90. ln -sf ../init.d/localnet ${ETCDIR}/rc.d/rc0.d/S90localnet
  91. ln -sf ../init.d/halt ${ETCDIR}/rc.d/rc0.d/S99halt
  92. rc1: files
  93. ln -sf ../init.d/network ${ETCDIR}/rc.d/rc1.d/K80network
  94. ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc1.d/K90sysklogd
  95. rc2: files
  96. ln -sf ../init.d/network ${ETCDIR}/rc.d/rc2.d/K80network
  97. ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc2.d/K90sysklogd
  98. rc3: files
  99. ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc3.d/S10sysklogd
  100. ln -sf ../init.d/network ${ETCDIR}/rc.d/rc3.d/S20network
  101. rc4: files
  102. ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc4.d/S10sysklogd
  103. ln -sf ../init.d/network ${ETCDIR}/rc.d/rc4.d/S20network
  104. rc5: files
  105. ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc5.d/S10sysklogd
  106. ln -sf ../init.d/network ${ETCDIR}/rc.d/rc5.d/S20network
  107. rc6: files
  108. ln -sf ../init.d/network ${ETCDIR}/rc.d/rc6.d/K80network
  109. ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc6.d/K90sysklogd
  110. ln -sf ../init.d/sendsignals ${ETCDIR}/rc.d/rc6.d/S60sendsignals
  111. ln -sf ../init.d/swap ${ETCDIR}/rc.d/rc6.d/S65swap
  112. ln -sf ../init.d/mountfs ${ETCDIR}/rc.d/rc6.d/S70mountfs
  113. ln -sf ../init.d/localnet ${ETCDIR}/rc.d/rc6.d/S90localnet
  114. ln -sf ../init.d/reboot ${ETCDIR}/rc.d/rc6.d/S99reboot
  115. uninstall:
  116. rm -rf ${DESTDIR}/lib/services ${DESTDIR}/lib/lsb ${ETCDIR}/rc.d ${ETCDIR}/init.d \
  117. ${SBIN}/ifup ${SBIN}/ifdown ${MAN8}/ifup.8 ${MAN8}/ifdown.8 \
  118. ${ETCDIR}/sysconfig/rc
  119. .PHONY: all create-dirs install files links rcS rc0 rc1 rc2 rc3 rc4 rc5 rc6 uninstall