Makefile.custom 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. # ==========================================================================
  2. # Build system
  3. # ==========================================================================
  4. busybox.links: $(srctree)/applets/busybox.mkll $(objtree)/include/autoconf.h $(srctree)/include/applets.h
  5. $(Q)-$(SHELL) $^ >$@
  6. .PHONY: install
  7. ifeq ($(CONFIG_INSTALL_APPLET_SYMLINKS),y)
  8. INSTALL_OPTS:= --symlinks
  9. endif
  10. ifeq ($(CONFIG_INSTALL_APPLET_HARDLINKS),y)
  11. INSTALL_OPTS:= --hardlinks
  12. endif
  13. ifeq ($(CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS),y)
  14. ifeq ($(CONFIG_INSTALL_SH_APPLET_SYMLINK),y)
  15. INSTALL_OPTS:= --sw-sh-sym
  16. endif
  17. ifeq ($(CONFIG_INSTALL_SH_APPLET_HARDLINK),y)
  18. INSTALL_OPTS:= --sw-sh-hard
  19. endif
  20. ifeq ($(CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER),y)
  21. INSTALL_OPTS:= --scriptwrapper
  22. endif
  23. endif
  24. install: $(srctree)/applets/install.sh busybox busybox.links
  25. $(Q)DO_INSTALL_LIBS="$(strip $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS))" \
  26. $(SHELL) $< $(CONFIG_PREFIX) $(INSTALL_OPTS)
  27. ifeq ($(strip $(CONFIG_FEATURE_SUID)),y)
  28. @echo
  29. @echo
  30. @echo --------------------------------------------------
  31. @echo You will probably need to make your busybox binary
  32. @echo setuid root to ensure all configured applets will
  33. @echo work properly.
  34. @echo --------------------------------------------------
  35. @echo
  36. endif
  37. uninstall: busybox.links
  38. rm -f $(CONFIG_PREFIX)/bin/busybox
  39. for i in `cat busybox.links` ; do rm -f $(CONFIG_PREFIX)$$i; done
  40. ifneq ($(strip $(DO_INSTALL_LIBS)),n)
  41. for i in $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS); do \
  42. rm -f $(CONFIG_PREFIX)$$i; \
  43. done
  44. endif
  45. check test: busybox busybox.links
  46. bindir=$(objtree) srcdir=$(srctree)/testsuite SED="$(SED)" \
  47. $(SHELL) $(srctree)/testsuite/runtest $(if $(KBUILD_VERBOSE:0=),-v)
  48. .PHONY: release
  49. release: distclean
  50. cd ..; \
  51. rm -r -f busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION); \
  52. cp -a busybox busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) && { \
  53. find busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ -type d \
  54. -name .svn \
  55. -print \
  56. -exec rm -r -f {} \; ; \
  57. find busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ -type f \
  58. -name .\#* \
  59. -print \
  60. -exec rm -f {} \; ; \
  61. tar -czf busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION).tar.gz \
  62. busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ ; }
  63. .PHONY: checkhelp
  64. checkhelp:
  65. $(Q)$(srctree)/scripts/checkhelp.awk \
  66. $(patsubst %,$(srctree)/%,$(wildcard $(patsubst %,%/Config.in,$(busybox-dirs) ./)))
  67. .PHONY: sizes
  68. sizes: busybox_unstripped
  69. $(NM) --size-sort $(<)
  70. .PHONY: bloatcheck
  71. bloatcheck: busybox_old busybox_unstripped
  72. @$(srctree)/scripts/bloat-o-meter busybox_old busybox_unstripped
  73. @$(CROSS_COMPILE)size busybox_old busybox_unstripped
  74. .PHONY: baseline
  75. baseline: busybox_unstripped
  76. @mv busybox_unstripped busybox_old
  77. .PHONY: objsizes
  78. objsizes: busybox_unstripped
  79. $(srctree)/scripts/objsizes
  80. .PHONY: stksizes
  81. stksizes: busybox_unstripped
  82. $(CROSS_COMPILE)objdump -d busybox_unstripped | $(srctree)/scripts/checkstack.pl $(ARCH) | uniq
  83. .PHONY: bigdata
  84. bigdata: busybox_unstripped
  85. $(CROSS_COMPILE)nm --size-sort busybox_unstripped | grep -vi ' [tr] '
  86. # Documentation Targets
  87. .PHONY: doc
  88. doc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html
  89. docs/busybox.pod: $(srctree)/docs/busybox_header.pod \
  90. $(srctree)/include/usage.h \
  91. $(srctree)/docs/busybox_footer.pod \
  92. $(srctree)/docs/autodocifier.pl
  93. $(disp_doc)
  94. $(Q)-mkdir -p docs
  95. $(Q)-( cat $(srctree)/docs/busybox_header.pod ; \
  96. $(srctree)/docs/autodocifier.pl $(srctree)/include/usage.h ; \
  97. cat $(srctree)/docs/busybox_footer.pod ; ) > docs/busybox.pod
  98. docs/BusyBox.txt: docs/busybox.pod
  99. $(disp_doc)
  100. $(Q)-mkdir -p docs
  101. $(Q)-pod2text $< > $@
  102. docs/BusyBox.1: docs/busybox.pod
  103. $(disp_doc)
  104. $(Q)-mkdir -p docs
  105. $(Q)-pod2man --center=BusyBox --release="version $(VERSION)" \
  106. $< > $@
  107. docs/BusyBox.html: docs/busybox.net/BusyBox.html
  108. $(disp_doc)
  109. $(Q)-mkdir -p docs
  110. $(Q)-rm -f docs/BusyBox.html
  111. $(Q)-cp docs/busybox.net/BusyBox.html docs/BusyBox.html
  112. docs/busybox.net/BusyBox.html: docs/busybox.pod
  113. $(Q)-mkdir -p docs/busybox.net
  114. $(Q)-pod2html --noindex $< > \
  115. docs/busybox.net/BusyBox.html
  116. $(Q)-rm -f pod2htm*
  117. # documentation, cross-reference
  118. # Modern distributions already ship synopsis packages (e.g. debian)
  119. # If you have an old distribution go to http://synopsis.fresco.org/
  120. syn_tgt = $(wildcard $(patsubst %,%/*.c,$(busybox-alldirs)))
  121. syn = $(patsubst %.c, %.syn, $(syn_tgt))
  122. comma:= ,
  123. brace_open:= (
  124. brace_close:= )
  125. SYN_CPPFLAGS := $(strip $(CPPFLAGS) $(EXTRA_CPPFLAGS))
  126. SYN_CPPFLAGS := $(subst $(brace_open),\$(brace_open),$(SYN_CPPFLAGS))
  127. SYN_CPPFLAGS := $(subst $(brace_close),\$(brace_close),$(SYN_CPPFLAGS))
  128. #SYN_CPPFLAGS := $(subst ",\",$(SYN_CPPFLAGS))
  129. #")
  130. #SYN_CPPFLAGS := [$(patsubst %,'%'$(comma),$(SYN_CPPFLAGS))'']
  131. %.syn: %.c
  132. synopsis -p C -l Comments.SSDFilter,Comments.Previous -Wp,preprocess=True,cppflags="'$(SYN_CPPFLAGS)'" -o $@ $<
  133. .PHONY: html
  134. html: $(syn)
  135. synopsis -f HTML -Wf,title="'BusyBox Documentation'" -o $@ $^
  136. -include $(srctree)/Makefile.local