Makefile.custom 4.5 KB

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