Makefile 5.7 KB

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