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 install: $(srctree)/applets/install.sh busybox busybox.links
32 $(Q)DO_INSTALL_LIBS="$(strip $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS))" \
33 $(SHELL) $< $(CONFIG_PREFIX) $(INSTALL_OPTS)
34 ifeq ($(strip $(CONFIG_FEATURE_SUID)),y)
37 @echo --------------------------------------------------
38 @echo You will probably need to make your busybox binary
39 @echo setuid root to ensure all configured applets will
41 @echo --------------------------------------------------
45 uninstall: busybox.links
46 rm -f $(CONFIG_PREFIX)/bin/busybox
47 for i in `cat busybox.links` ; do rm -f $(CONFIG_PREFIX)$$i; done
48 ifneq ($(strip $(DO_INSTALL_LIBS)),n)
49 for i in $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS); do \
50 rm -f $(CONFIG_PREFIX)$$i; \
54 # Not very elegant: copies testsuite to objdir...
55 # (cp -pPR is POSIX-compliant (cp -dpR or cp -a would not be))
58 ifeq ($(CONFIG_UNIT_TEST),y)
59 UNIT_CMD = ./busybox unit
61 check test: busybox busybox.links
63 test -d $(objtree)/testsuite || cp -pPR $(srctree)/testsuite $(objtree)
64 bindir=$(objtree) srcdir=$(srctree)/testsuite \
65 $(SHELL) -c "cd $(objtree)/testsuite && $(srctree)/testsuite/runtest $(if $(KBUILD_VERBOSE:0=),-v)"
70 rm -r -f busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION); \
71 cp -pPR busybox busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) && { \
72 find busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ -type d \
75 -exec rm -r -f {} \; ; \
76 find busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ -type d \
79 -exec rm -r -f {} \; ; \
80 find busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ -type f \
84 find busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ -type f \
88 tar -czf busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION).tar.gz \
89 busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ ; }
93 $(Q)$(srctree)/scripts/checkhelp.awk \
94 $(patsubst %,$(srctree)/%,$(wildcard $(patsubst %,%/Config.in,$(busybox-dirs) ./)))
97 sizes: busybox_unstripped
98 $(NM) --size-sort $(<)
101 bloatcheck: busybox_old busybox_unstripped
102 @$(srctree)/scripts/bloat-o-meter busybox_old busybox_unstripped
103 @$(CROSS_COMPILE)size busybox_old busybox_unstripped
106 baseline: busybox_unstripped
107 @mv busybox_unstripped busybox_old
110 objsizes: busybox_unstripped
111 $(srctree)/scripts/objsizes
114 stksizes: busybox_unstripped
115 $(CROSS_COMPILE)objdump -d busybox_unstripped | $(srctree)/scripts/checkstack.pl $(ARCH) | uniq
118 bigdata: busybox_unstripped
119 $(CROSS_COMPILE)nm --size-sort busybox_unstripped | grep -vi ' [trw] '
121 # Documentation Targets
123 doc: docs/busybox.pod docs/BusyBox.txt docs/busybox.1 docs/BusyBox.html
125 # FIXME: Doesn't belong here
127 quiet_cmd_doc = $(Q)echo " DOC $(@F)"
129 disp_doc = $($(quiet)cmd_doc)
131 # sed adds newlines after "Options:" etc,
132 # this is needed in order to get good BusyBox.{1,txt,html}
133 docs/busybox.pod: $(srctree)/docs/busybox_header.pod \
135 $(srctree)/docs/busybox_footer.pod \
140 cat $(srctree)/docs/busybox_header.pod; \
142 applets/usage_pod | sed 's/^[A-Za-z][A-Za-z ]*[a-z]:$$/&\n/'; \
143 cat $(srctree)/docs/busybox_footer.pod; \
146 docs/BusyBox.txt: docs/busybox.pod
149 $(Q)-pod2text $< > $@
151 docs/busybox.1: docs/busybox.pod
154 $(Q)-pod2man --center=busybox --release="version $(KERNELVERSION)" $< > $@
156 docs/BusyBox.html: docs/busybox.net/BusyBox.html
159 $(Q)-rm -f docs/BusyBox.html
160 $(Q)-cp docs/busybox.net/BusyBox.html docs/BusyBox.html
162 docs/busybox.net/BusyBox.html: docs/busybox.pod
163 $(Q)-mkdir -p docs/busybox.net
164 $(Q)-pod2html --noindex $< > $@
167 # documentation, cross-reference
168 # Modern distributions already ship synopsis packages (e.g. debian)
169 # If you have an old distribution go to http://synopsis.fresco.org/
170 syn_tgt = $(wildcard $(patsubst %,%/*.c,$(busybox-alldirs)))
171 syn = $(patsubst %.c, %.syn, $(syn_tgt))
177 SYN_CPPFLAGS := $(strip $(CPPFLAGS) $(EXTRA_CPPFLAGS))
178 SYN_CPPFLAGS := $(subst $(brace_open),\$(brace_open),$(SYN_CPPFLAGS))
179 SYN_CPPFLAGS := $(subst $(brace_close),\$(brace_close),$(SYN_CPPFLAGS))
180 #SYN_CPPFLAGS := $(subst ",\",$(SYN_CPPFLAGS))
182 #SYN_CPPFLAGS := [$(patsubst %,'%'$(comma),$(SYN_CPPFLAGS))'']
185 synopsis -p C -l Comments.SSDFilter,Comments.Previous -Wp,preprocess=True,cppflags="'$(SYN_CPPFLAGS)'" -o $@ $<
189 synopsis -f HTML -Wf,title="'BusyBox Documentation'" -o $@ $^
191 -include $(srctree)/Makefile.local