Denis Vlasenko | 7d219aa | 2006-10-05 10:17:08 +0000 | [diff] [blame] | 1 | ### # defconfig is allyesconfig minus any features that are specialized enough |
| 2 | ### # or cause enough behavior change that the user really should switch them on |
| 3 | ### # manually if that's what they want. Sort of "maximum sane config". |
| 4 | |
| 5 | ### defconfig: scripts/config/conf |
| 6 | ### @./scripts/config/conf -y $(CONFIG_CONFIG_IN) > /dev/null |
| 7 | ### @$(SED) -i -r -e "s/^(CONFIG_(DEBUG.*|STATIC|SELINUX|NITPICK|BUILD_(AT_ONCE|LIBBUSYBOX)|FEATURE_(DEVFS|FULL_LIBBUSYBOX|SHARED_BUSYBOX|MTAB_SUPPORT|CLEAN_UP|UDHCP_DEBUG)|INSTALL_NO_USR))=.*/# \1 is not set/" .config |
| 8 | ### @./scripts/config/conf -o $(CONFIG_CONFIG_IN) > /dev/null |
| 9 | |
| 10 | ### allbareconfig: scripts/config/conf |
| 11 | ### @./scripts/config/conf -y $(CONFIG_CONFIG_IN) > /dev/null |
| 12 | ### @$(SED) -i -r -e "s/^(CONFIG_(DEBUG|STATIC|SELINUX|DEVFSD|NC_GAPING_SECURITY_HOLE|BUILD_AT_ONCE)).*/# \1 is not set/" .config |
| 13 | ### @$(SED) -i -e "/FEATURE/s/=.*//;/^[^#]/s/.*FEATURE.*/# \0 is not set/;" .config |
| 14 | ### @echo "CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y" >> .config |
| 15 | ### @yes n | ./scripts/config/conf -o $(CONFIG_CONFIG_IN) > /dev/null |
| 16 | |
| 17 | ### hosttools: |
| 18 | ### $(Q)cp .config .config.bak || noold=yea |
| 19 | ### $(Q)$(MAKE) CC="$(HOSTCC)" CFLAGS="$(HOSTCFLAGS) $(INCS)" allnoconfig |
| 20 | ### $(Q)mv .config .config.in |
| 21 | ### $(Q)(grep -v CONFIG_SED .config.in ; \ |
| 22 | ### echo "CONFIG_SED=y" ; ) > .config |
| 23 | ### $(Q)$(MAKE) CC="$(HOSTCC)" CFLAGS="$(HOSTCFLAGS) $(INCS)" oldconfig include/bb_config.h |
| 24 | ### $(Q)$(MAKE) CC="$(HOSTCC)" CFLAGS="$(HOSTCFLAGS) $(INCS)" busybox |
| 25 | ### $(Q)[ -f .config.bak ] && mv .config.bak .config || rm .config |
| 26 | ### mv busybox sed |
| 27 | ### @echo "Now do: $(MAKE) SED=$(objtree)/sed <target>" |
| 28 | |
| 29 | %.bflt: %_unstripped |
| 30 | $(CROSS_COMPILE)elf2flt $(ELF2FLTFLAGS) $< -o $@ |
| 31 | |
| 32 | busybox.links: $(srctree)/applets/busybox.mkll include/bb_config.h $(srctree)/include/applets.h |
| 33 | $(Q)-$(SHELL) $^ >$@ |
| 34 | |
| 35 | .PHONY: install |
| 36 | install: $(srctree)/applets/install.sh busybox busybox.links |
| 37 | $(Q)DO_INSTALL_LIBS="$(strip $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS))" \ |
| 38 | $(SHELL) $< $(CONFIG_PREFIX) $(INSTALL_OPTS) |
| 39 | ifeq ($(strip $(CONFIG_FEATURE_SUID)),y) |
| 40 | @echo |
| 41 | @echo |
| 42 | @echo -------------------------------------------------- |
| 43 | @echo You will probably need to make your busybox binary |
| 44 | @echo setuid root to ensure all configured applets will |
| 45 | @echo work properly. |
| 46 | @echo -------------------------------------------------- |
| 47 | @echo |
| 48 | endif |
| 49 | |
| 50 | uninstall: busybox.links |
| 51 | rm -f $(CONFIG_PREFIX)/bin/busybox |
| 52 | for i in `cat busybox.links` ; do rm -f $(CONFIG_PREFIX)$$i; done |
| 53 | ifneq ($(strip $(DO_INSTALL_LIBS)),n) |
| 54 | for i in $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS); do \ |
| 55 | rm -f $(CONFIG_PREFIX)$$i; \ |
| 56 | done |
| 57 | endif |
| 58 | |
| 59 | check test: busybox |
| 60 | bindir=$(objtree) srcdir=$(srctree)/testsuite SED="$(SED)" \ |
| 61 | $(SHELL) $(srctree)/testsuite/runtest $(if $(KBUILD_VERBOSE:1=),-v) |
| 62 | |
| 63 | ### checkhelp: |
| 64 | ### $(Q)$(srctree)/scripts/checkhelp.awk \ |
| 65 | ### $(wildcard $(patsubst %,%/Config.in,$(SRC_DIRS) ./)) |
| 66 | |
| 67 | .PHONY: sizes |
| 68 | sizes: busybox_unstripped |
| 69 | $(NM) --size-sort $(<) |
| 70 | |
| 71 | .PHONY: bloatcheck |
| 72 | bloatcheck: busybox_old busybox_unstripped |
| 73 | @$(srctree)/scripts/bloat-o-meter busybox_old busybox_unstripped |
| 74 | |
| 75 | .PHONY: baseline |
| 76 | baseline: busybox_unstripped |
| 77 | @mv busybox_unstripped busybox_old |
| 78 | |
| 79 | .PHONY: objsizes |
| 80 | objsizes: busybox_unstripped |
Denis Vlasenko | 1868409 | 2006-10-05 17:11:08 +0000 | [diff] [blame^] | 81 | $(srctree)/scripts/objsizes |
Denis Vlasenko | 7d219aa | 2006-10-05 10:17:08 +0000 | [diff] [blame] | 82 | |
| 83 | # Documentation Targets |
| 84 | .PHONY: doc |
| 85 | doc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html |
| 86 | |
| 87 | docs/busybox.pod: $(srctree)/docs/busybox_header.pod \ |
| 88 | $(srctree)/include/usage.h \ |
| 89 | $(srctree)/docs/busybox_footer.pod \ |
| 90 | $(srctree)/docs/autodocifier.pl |
| 91 | $(disp_doc) |
| 92 | $(Q)-mkdir -p docs |
| 93 | $(Q)-( cat $(srctree)/docs/busybox_header.pod ; \ |
| 94 | $(srctree)/docs/autodocifier.pl $(srctree)/include/usage.h ; \ |
| 95 | cat $(srctree)/docs/busybox_footer.pod ; ) > docs/busybox.pod |
| 96 | |
| 97 | docs/BusyBox.txt: docs/busybox.pod |
| 98 | $(disp_doc) |
| 99 | $(Q)-mkdir -p docs |
| 100 | $(Q)-pod2text $< > $@ |
| 101 | |
| 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 | |
| 108 | docs/BusyBox.html: docs/busybox.net/BusyBox.html |
| 109 | $(disp_doc) |
| 110 | $(Q)-mkdir -p docs |
| 111 | $(Q)-rm -f docs/BusyBox.html |
| 112 | $(Q)-cp docs/busybox.net/BusyBox.html docs/BusyBox.html |
| 113 | |
| 114 | docs/busybox.net/BusyBox.html: docs/busybox.pod |
| 115 | $(Q)-mkdir -p docs/busybox.net |
| 116 | $(Q)-pod2html --noindex $< > \ |
| 117 | docs/busybox.net/BusyBox.html |
| 118 | $(Q)-rm -f pod2htm* |
| 119 | |
| 120 | # documentation, cross-reference |
| 121 | # Modern distributions already ship synopsis packages (e.g. debian) |
| 122 | # If you have an old distribution go to http://synopsis.fresco.org/ |
| 123 | syn_tgt := $(wildcard $(patsubst %,%/*.c,$(SRC_DIRS))) |
| 124 | syn := $(patsubst %.c, %.syn, $(syn_tgt)) |
| 125 | |
| 126 | %.syn: %.c |
| 127 | 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 $@ $< |
| 128 | |
| 129 | .PHONY: html |
| 130 | html: $(syn) |
| 131 | synopsis -f HTML -Wf,title="'BusyBox Documentation'" -o $@ $^ |