1
0

Makefile 5.7 KB

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