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 |
| 12 | install: $(srctree)/applets/install.sh busybox busybox.links |
| 13 | $(Q)DO_INSTALL_LIBS="$(strip $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS))" \ |
| 14 | $(SHELL) $< $(CONFIG_PREFIX) $(INSTALL_OPTS) |
| 15 | ifeq ($(strip $(CONFIG_FEATURE_SUID)),y) |
| 16 | @echo |
| 17 | @echo |
| 18 | @echo -------------------------------------------------- |
| 19 | @echo You will probably need to make your busybox binary |
| 20 | @echo setuid root to ensure all configured applets will |
| 21 | @echo work properly. |
| 22 | @echo -------------------------------------------------- |
| 23 | @echo |
| 24 | endif |
| 25 | |
| 26 | uninstall: busybox.links |
| 27 | rm -f $(CONFIG_PREFIX)/bin/busybox |
| 28 | for i in `cat busybox.links` ; do rm -f $(CONFIG_PREFIX)$$i; done |
| 29 | ifneq ($(strip $(DO_INSTALL_LIBS)),n) |
| 30 | for i in $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS); do \ |
| 31 | rm -f $(CONFIG_PREFIX)$$i; \ |
| 32 | done |
| 33 | endif |
| 34 | |
| 35 | check test: busybox |
| 36 | bindir=$(objtree) srcdir=$(srctree)/testsuite SED="$(SED)" \ |
| 37 | $(SHELL) $(srctree)/testsuite/runtest $(if $(KBUILD_VERBOSE:1=),-v) |
| 38 | |
| 39 | ### checkhelp: |
| 40 | ### $(Q)$(srctree)/scripts/checkhelp.awk \ |
| 41 | ### $(wildcard $(patsubst %,%/Config.in,$(SRC_DIRS) ./)) |
| 42 | |
| 43 | .PHONY: sizes |
| 44 | sizes: busybox_unstripped |
| 45 | $(NM) --size-sort $(<) |
| 46 | |
| 47 | .PHONY: bloatcheck |
| 48 | bloatcheck: busybox_old busybox_unstripped |
| 49 | @$(srctree)/scripts/bloat-o-meter busybox_old busybox_unstripped |
| 50 | |
| 51 | .PHONY: baseline |
| 52 | baseline: busybox_unstripped |
| 53 | @mv busybox_unstripped busybox_old |
| 54 | |
| 55 | .PHONY: objsizes |
| 56 | objsizes: busybox_unstripped |
Denis Vlasenko | 1868409 | 2006-10-05 17:11:08 +0000 | [diff] [blame] | 57 | $(srctree)/scripts/objsizes |
Denis Vlasenko | 7d219aa | 2006-10-05 10:17:08 +0000 | [diff] [blame] | 58 | |
| 59 | # Documentation Targets |
| 60 | .PHONY: doc |
| 61 | doc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html |
| 62 | |
| 63 | docs/busybox.pod: $(srctree)/docs/busybox_header.pod \ |
| 64 | $(srctree)/include/usage.h \ |
| 65 | $(srctree)/docs/busybox_footer.pod \ |
| 66 | $(srctree)/docs/autodocifier.pl |
| 67 | $(disp_doc) |
| 68 | $(Q)-mkdir -p docs |
| 69 | $(Q)-( cat $(srctree)/docs/busybox_header.pod ; \ |
| 70 | $(srctree)/docs/autodocifier.pl $(srctree)/include/usage.h ; \ |
| 71 | cat $(srctree)/docs/busybox_footer.pod ; ) > docs/busybox.pod |
| 72 | |
| 73 | docs/BusyBox.txt: docs/busybox.pod |
| 74 | $(disp_doc) |
| 75 | $(Q)-mkdir -p docs |
| 76 | $(Q)-pod2text $< > $@ |
| 77 | |
| 78 | docs/BusyBox.1: docs/busybox.pod |
| 79 | $(disp_doc) |
| 80 | $(Q)-mkdir -p docs |
| 81 | $(Q)-pod2man --center=BusyBox --release="version $(VERSION)" \ |
| 82 | $< > $@ |
| 83 | |
| 84 | docs/BusyBox.html: docs/busybox.net/BusyBox.html |
| 85 | $(disp_doc) |
| 86 | $(Q)-mkdir -p docs |
| 87 | $(Q)-rm -f docs/BusyBox.html |
| 88 | $(Q)-cp docs/busybox.net/BusyBox.html docs/BusyBox.html |
| 89 | |
| 90 | docs/busybox.net/BusyBox.html: docs/busybox.pod |
| 91 | $(Q)-mkdir -p docs/busybox.net |
| 92 | $(Q)-pod2html --noindex $< > \ |
| 93 | docs/busybox.net/BusyBox.html |
| 94 | $(Q)-rm -f pod2htm* |
| 95 | |
| 96 | # documentation, cross-reference |
| 97 | # Modern distributions already ship synopsis packages (e.g. debian) |
| 98 | # If you have an old distribution go to http://synopsis.fresco.org/ |
| 99 | syn_tgt := $(wildcard $(patsubst %,%/*.c,$(SRC_DIRS))) |
| 100 | syn := $(patsubst %.c, %.syn, $(syn_tgt)) |
| 101 | |
| 102 | %.syn: %.c |
| 103 | synopsis -p C -l Comments.SSDFilter,Comments.Previous $(INCS) -Wp,verbose,debug,preprocess,cppflags="'$(CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS) $(PROG_CFLAGS) $(PROG_LDFLAGS) $(CFLAGS_COMBINE) $(APPLETS_DEFINE) $(BUSYBOX_DEFINE)'" -o $@ $< |
| 104 | |
| 105 | .PHONY: html |
| 106 | html: $(syn) |
| 107 | synopsis -f HTML -Wf,title="'BusyBox Documentation'" -o $@ $^ |