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