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 | |
| 41 | check test: busybox |
| 42 | bindir=$(objtree) srcdir=$(srctree)/testsuite SED="$(SED)" \ |
| 43 | $(SHELL) $(srctree)/testsuite/runtest $(if $(KBUILD_VERBOSE:1=),-v) |
| 44 | |
Bernhard Reutner-Fischer | d6bbf99 | 2006-11-22 09:39:48 +0000 | [diff] [blame] | 45 | .PHONY: checkhelp |
| 46 | checkhelp: |
| 47 | $(Q)$(srctree)/scripts/checkhelp.awk \ |
| 48 | $(patsubst %,$(srctree)/%,$(wildcard $(patsubst %,%/Config.in,$(busybox-dirs) ./))) |
Denis Vlasenko | 7d219aa | 2006-10-05 10:17:08 +0000 | [diff] [blame] | 49 | |
| 50 | .PHONY: sizes |
| 51 | sizes: busybox_unstripped |
| 52 | $(NM) --size-sort $(<) |
| 53 | |
| 54 | .PHONY: bloatcheck |
| 55 | bloatcheck: busybox_old busybox_unstripped |
| 56 | @$(srctree)/scripts/bloat-o-meter busybox_old busybox_unstripped |
| 57 | |
| 58 | .PHONY: baseline |
| 59 | baseline: busybox_unstripped |
| 60 | @mv busybox_unstripped busybox_old |
| 61 | |
| 62 | .PHONY: objsizes |
| 63 | objsizes: busybox_unstripped |
Denis Vlasenko | 1868409 | 2006-10-05 17:11:08 +0000 | [diff] [blame] | 64 | $(srctree)/scripts/objsizes |
Denis Vlasenko | 7d219aa | 2006-10-05 10:17:08 +0000 | [diff] [blame] | 65 | |
Denis Vlasenko | 0025264 | 2006-11-30 20:41:28 +0000 | [diff] [blame] | 66 | .PHONY: bigdata |
| 67 | bigdata: busybox_unstripped |
| 68 | nm --size-sort busybox_unstripped | grep -vi ' [tr] ' | tail -20 |
| 69 | |
Denis Vlasenko | 7d219aa | 2006-10-05 10:17:08 +0000 | [diff] [blame] | 70 | # Documentation Targets |
| 71 | .PHONY: doc |
| 72 | doc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html |
| 73 | |
| 74 | docs/busybox.pod: $(srctree)/docs/busybox_header.pod \ |
| 75 | $(srctree)/include/usage.h \ |
| 76 | $(srctree)/docs/busybox_footer.pod \ |
| 77 | $(srctree)/docs/autodocifier.pl |
| 78 | $(disp_doc) |
| 79 | $(Q)-mkdir -p docs |
| 80 | $(Q)-( cat $(srctree)/docs/busybox_header.pod ; \ |
| 81 | $(srctree)/docs/autodocifier.pl $(srctree)/include/usage.h ; \ |
| 82 | cat $(srctree)/docs/busybox_footer.pod ; ) > docs/busybox.pod |
| 83 | |
| 84 | docs/BusyBox.txt: docs/busybox.pod |
| 85 | $(disp_doc) |
| 86 | $(Q)-mkdir -p docs |
| 87 | $(Q)-pod2text $< > $@ |
| 88 | |
| 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 | |
| 95 | docs/BusyBox.html: docs/busybox.net/BusyBox.html |
| 96 | $(disp_doc) |
| 97 | $(Q)-mkdir -p docs |
| 98 | $(Q)-rm -f docs/BusyBox.html |
| 99 | $(Q)-cp docs/busybox.net/BusyBox.html docs/BusyBox.html |
| 100 | |
| 101 | docs/busybox.net/BusyBox.html: docs/busybox.pod |
| 102 | $(Q)-mkdir -p docs/busybox.net |
| 103 | $(Q)-pod2html --noindex $< > \ |
| 104 | docs/busybox.net/BusyBox.html |
| 105 | $(Q)-rm -f pod2htm* |
| 106 | |
| 107 | # documentation, cross-reference |
| 108 | # Modern distributions already ship synopsis packages (e.g. debian) |
| 109 | # 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^] | 110 | syn_tgt = $(wildcard $(patsubst %,%/*.c,$(busybox-alldirs))) |
| 111 | syn = $(patsubst %.c, %.syn, $(syn_tgt)) |
Denis Vlasenko | 7d219aa | 2006-10-05 10:17:08 +0000 | [diff] [blame] | 112 | |
| 113 | %.syn: %.c |
Bernhard Reutner-Fischer | bc95f57 | 2006-12-06 15:29:00 +0000 | [diff] [blame^] | 114 | synopsis --verbose --debug -p C -l Comments.SSDFilter,Comments.Previous $(INCS) -Wp,verbose=True,debug=True,preprocess=True,cppflags="'$(CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS) $(PROG_CFLAGS) $(PROG_LDFLAGS) $(CFLAGS_COMBINE) $(APPLETS_DEFINE) $(BUSYBOX_DEFINE)'" -o $@ $< |
Denis Vlasenko | 7d219aa | 2006-10-05 10:17:08 +0000 | [diff] [blame] | 115 | |
| 116 | .PHONY: html |
| 117 | html: $(syn) |
| 118 | synopsis -f HTML -Wf,title="'BusyBox Documentation'" -o $@ $^ |