Makefile 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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 ]; then \
  64. install -m ${CONFMODE} lfs/sysconfig/rc ${EXTDIR}/sysconfig/ ;\
  65. fi
  66. if [ ! -f ${EXTDIR}/sysconfig/rc.site ]; then \
  67. install -m ${CONFMODE} lfs/sysconfig/rc.site ${EXTDIR}/sysconfig/ ;\
  68. fi
  69. links: rcS rc0 rc1 rc2 rc3 rc4 rc5 rc6
  70. rcS: files
  71. ln -sf ../init.d/mountvirtfs ${EXTDIR}/rc.d/rcS.d/S00mountvirtfs
  72. ln -sf ../init.d/modules ${EXTDIR}/rc.d/rcS.d/S05modules
  73. ln -sf ../init.d/localnet ${EXTDIR}/rc.d/rcS.d/S08localnet
  74. ln -sf ../init.d/udev ${EXTDIR}/rc.d/rcS.d/S10udev
  75. ln -sf ../init.d/swap ${EXTDIR}/rc.d/rcS.d/S20swap
  76. ln -sf ../init.d/checkfs ${EXTDIR}/rc.d/rcS.d/S30checkfs
  77. ln -sf ../init.d/mountfs ${EXTDIR}/rc.d/rcS.d/S40mountfs
  78. ln -sf ../init.d/cleanfs ${EXTDIR}/rc.d/rcS.d/S45cleanfs
  79. ln -sf ../init.d/udev_retry ${EXTDIR}/rc.d/rcS.d/S50udev_retry
  80. ln -sf ../init.d/console ${EXTDIR}/rc.d/rcS.d/S70console
  81. ln -sf ../init.d/sysctl ${EXTDIR}/rc.d/rcS.d/S90sysctl
  82. rc0: files
  83. ln -sf ../init.d/network ${EXTDIR}/rc.d/rc0.d/K80network
  84. ln -sf ../init.d/sysklogd ${EXTDIR}/rc.d/rc0.d/K90sysklogd
  85. ln -sf ../init.d/sendsignals ${EXTDIR}/rc.d/rc0.d/S60sendsignals
  86. ln -sf ../init.d/swap ${EXTDIR}/rc.d/rc0.d/S65swap
  87. ln -sf ../init.d/mountfs ${EXTDIR}/rc.d/rc0.d/S70mountfs
  88. ln -sf ../init.d/localnet ${EXTDIR}/rc.d/rc0.d/S90localnet
  89. ln -sf ../init.d/halt ${EXTDIR}/rc.d/rc0.d/S99halt
  90. rc1: files
  91. ln -sf ../init.d/network ${EXTDIR}/rc.d/rc1.d/K80network
  92. ln -sf ../init.d/sysklogd ${EXTDIR}/rc.d/rc1.d/K90sysklogd
  93. rc2: files
  94. ln -sf ../init.d/network ${EXTDIR}/rc.d/rc2.d/K80network
  95. ln -sf ../init.d/sysklogd ${EXTDIR}/rc.d/rc2.d/K90sysklogd
  96. rc3: files
  97. ln -sf ../init.d/sysklogd ${EXTDIR}/rc.d/rc3.d/S10sysklogd
  98. ln -sf ../init.d/network ${EXTDIR}/rc.d/rc3.d/S20network
  99. rc4: files
  100. ln -sf ../init.d/sysklogd ${EXTDIR}/rc.d/rc4.d/S10sysklogd
  101. ln -sf ../init.d/network ${EXTDIR}/rc.d/rc4.d/S20network
  102. rc5: files
  103. ln -sf ../init.d/sysklogd ${EXTDIR}/rc.d/rc5.d/S10sysklogd
  104. ln -sf ../init.d/network ${EXTDIR}/rc.d/rc5.d/S20network
  105. rc6: files
  106. ln -sf ../init.d/network ${EXTDIR}/rc.d/rc6.d/K80network
  107. ln -sf ../init.d/sysklogd ${EXTDIR}/rc.d/rc6.d/K90sysklogd
  108. ln -sf ../init.d/sendsignals ${EXTDIR}/rc.d/rc6.d/S60sendsignals
  109. ln -sf ../init.d/swap ${EXTDIR}/rc.d/rc6.d/S65swap
  110. ln -sf ../init.d/mountfs ${EXTDIR}/rc.d/rc6.d/S70mountfs
  111. ln -sf ../init.d/localnet ${EXTDIR}/rc.d/rc6.d/S90localnet
  112. ln -sf ../init.d/reboot ${EXTDIR}/rc.d/rc6.d/S99reboot
  113. uninstall:
  114. rm -rf ${DESTDIR}/lib/services ${DESTDIR}/lib/lsb ${EXTDIR}/rc.d ${EXTDIR}/init.d \
  115. ${SBIN}/ifup ${SBIN}/ifdown ${MAN8}/ifup.8 ${MAN8}/ifdown.8 \
  116. ${EXTDIR}/sysconfig/rc
  117. .PHONY: all create-dirs install files links rcS rc0 rc1 rc2 rc3 rc4 rc5 rc6 uninstall