1 # ==========================================================================
3 # ==========================================================================
5 busybox.links: $(srctree)/applets/busybox.mkll $(objtree)/include/autoconf.h include/applets.h
8 busybox.cfg.suid: $(srctree)/applets/busybox.mksuid $(objtree)/include/autoconf.h include/applets.h
9 $(Q)-SUID="yes" $(SHELL) $^ > $@
10 busybox.cfg.nosuid: $(srctree)/applets/busybox.mksuid $(objtree)/include/autoconf.h include/applets.h
11 $(Q)-SUID="DROP" $(SHELL) $^ > $@
14 ifeq ($(CONFIG_INSTALL_APPLET_SYMLINKS),y)
15 INSTALL_OPTS:= --symlinks
17 ifeq ($(CONFIG_INSTALL_APPLET_HARDLINKS),y)
18 INSTALL_OPTS:= --hardlinks
20 ifeq ($(CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS),y)
21 ifeq ($(CONFIG_INSTALL_SH_APPLET_SYMLINK),y)
22 INSTALL_OPTS:= --sw-sh-sym
24 ifeq ($(CONFIG_INSTALL_SH_APPLET_HARDLINK),y)
25 INSTALL_OPTS:= --sw-sh-hard
27 ifeq ($(CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER),y)
28 INSTALL_OPTS:= --scriptwrapper
31 ifeq ($(CONFIG_FEATURE_INDIVIDUAL),y)
32 INSTALL_OPTS:= --binaries
33 LIBBUSYBOX_SONAME:= 0_lib/libbusybox.so.$(BB_VER)
35 install: $(srctree)/applets/install.sh busybox busybox.links
36 $(Q)DO_INSTALL_LIBS="$(strip $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS))" \
37 $(SHELL) $< $(CONFIG_PREFIX) $(INSTALL_OPTS)
38 ifeq ($(strip $(CONFIG_FEATURE_SUID)),y)
41 @echo --------------------------------------------------
42 @echo You will probably need to make your busybox binary
43 @echo setuid root to ensure all configured applets will
45 @echo --------------------------------------------------
49 install-noclobber: INSTALL_OPTS+=--noclobber
50 install-noclobber: install
52 uninstall: busybox.links
53 rm -f $(CONFIG_PREFIX)/bin/busybox
54 for i in `cat busybox.links` ; do rm -f $(CONFIG_PREFIX)$$i; done
55 ifneq ($(strip $(DO_INSTALL_LIBS)),n)
56 for i in $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS); do \
57 rm -f $(CONFIG_PREFIX)$$i; \
61 # Not very elegant: copies testsuite to objdir...
62 # (cp -pPR is POSIX-compliant (cp -dpR or cp -a would not be))
65 ifeq ($(CONFIG_UNIT_TEST),y)
66 UNIT_CMD = ./busybox unit
68 check test: busybox busybox.links
70 test -d $(objtree)/testsuite || cp -pPR $(srctree)/testsuite $(objtree)
71 bindir=$(objtree) srcdir=$(srctree)/testsuite \
72 $(SHELL) -c "cd $(objtree)/testsuite && $(srctree)/testsuite/runtest $(if $(KBUILD_VERBOSE:0=),-v)"
77 rm -r -f busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION); \
78 cp -pPR busybox busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) && { \
79 find busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ -type d \
82 -exec rm -r -f {} \; ; \
83 find busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ -type d \
86 -exec rm -r -f {} \; ; \
87 find busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ -type f \
91 find busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ -type f \
95 tar -czf busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION).tar.gz \
96 busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ ; }
100 $(Q)$(srctree)/scripts/checkhelp.awk \
101 $(patsubst %,$(srctree)/%,$(wildcard $(patsubst %,%/Config.in,$(busybox-dirs) ./)))
104 sizes: busybox_unstripped
105 $(NM) --size-sort $(<)
108 bloatcheck: busybox_old busybox_unstripped
109 @$(srctree)/scripts/bloat-o-meter busybox_old busybox_unstripped
110 @$(CROSS_COMPILE)size busybox_old busybox_unstripped
113 baseline: busybox_unstripped
114 @mv busybox_unstripped busybox_old
117 objsizes: busybox_unstripped
118 $(srctree)/scripts/objsizes
121 stksizes: busybox_unstripped
122 $(CROSS_COMPILE)objdump -d busybox_unstripped | $(srctree)/scripts/checkstack.pl $(ARCH) | uniq
125 bigdata: busybox_unstripped
126 $(CROSS_COMPILE)nm --size-sort busybox_unstripped | grep -vi ' [trw] '
128 # Documentation Targets
130 doc: docs/busybox.pod docs/BusyBox.txt docs/busybox.1 docs/BusyBox.html
132 # FIXME: Doesn't belong here
134 quiet_cmd_doc = $(Q)echo " DOC $(@F)"
136 disp_doc = $($(quiet)cmd_doc)
138 # sed adds newlines after "Options:" etc,
139 # this is needed in order to get good BusyBox.{1,txt,html}
140 docs/busybox.pod: $(srctree)/docs/busybox_header.pod \
142 $(srctree)/docs/busybox_footer.pod \
147 cat $(srctree)/docs/busybox_header.pod; \
149 applets/usage_pod | sed 's/^[A-Za-z][A-Za-z ]*[a-z]:$$/&\n/'; \
150 cat $(srctree)/docs/busybox_footer.pod; \
153 docs/BusyBox.txt: docs/busybox.pod
156 $(Q)-pod2text $< > $@
158 docs/busybox.1: docs/busybox.pod
161 $(Q)-pod2man --center=busybox --release="version $(KERNELVERSION)" $< > $@
163 docs/BusyBox.html: docs/busybox.net/BusyBox.html
166 $(Q)-rm -f docs/BusyBox.html
167 $(Q)-cp docs/busybox.net/BusyBox.html docs/BusyBox.html
169 docs/busybox.net/BusyBox.html: docs/busybox.pod
170 $(Q)-mkdir -p docs/busybox.net
171 $(Q)-pod2html --noindex $< > $@
174 # documentation, cross-reference
175 # Modern distributions already ship synopsis packages (e.g. debian)
176 # If you have an old distribution go to http://synopsis.fresco.org/
177 syn_tgt = $(wildcard $(patsubst %,%/*.c,$(busybox-alldirs)))
178 syn = $(patsubst %.c, %.syn, $(syn_tgt))
184 SYN_CPPFLAGS := $(strip $(CPPFLAGS) $(EXTRA_CPPFLAGS))
185 SYN_CPPFLAGS := $(subst $(brace_open),\$(brace_open),$(SYN_CPPFLAGS))
186 SYN_CPPFLAGS := $(subst $(brace_close),\$(brace_close),$(SYN_CPPFLAGS))
187 #SYN_CPPFLAGS := $(subst ",\",$(SYN_CPPFLAGS))
189 #SYN_CPPFLAGS := [$(patsubst %,'%'$(comma),$(SYN_CPPFLAGS))'']
192 synopsis -p C -l Comments.SSDFilter,Comments.Previous -Wp,preprocess=True,cppflags="'$(SYN_CPPFLAGS)'" -o $@ $<
196 synopsis -f HTML -Wf,title="'BusyBox Documentation'" -o $@ $^
198 -include $(srctree)/Makefile.local