1 # ==========================================================================
3 # ==========================================================================
5 busybox.links: $(srctree)/applets/busybox.mkll $(objtree)/include/autoconf.h include/applets.h
9 ifeq ($(CONFIG_INSTALL_APPLET_SYMLINKS),y)
10 INSTALL_OPTS:= --symlinks
12 ifeq ($(CONFIG_INSTALL_APPLET_HARDLINKS),y)
13 INSTALL_OPTS:= --hardlinks
15 ifeq ($(CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS),y)
16 ifeq ($(CONFIG_INSTALL_SH_APPLET_SYMLINK),y)
17 INSTALL_OPTS:= --sw-sh-sym
19 ifeq ($(CONFIG_INSTALL_SH_APPLET_HARDLINK),y)
20 INSTALL_OPTS:= --sw-sh-hard
22 ifeq ($(CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER),y)
23 INSTALL_OPTS:= --scriptwrapper
26 install: $(srctree)/applets/install.sh busybox busybox.links
27 $(Q)DO_INSTALL_LIBS="$(strip $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS))" \
28 $(SHELL) $< $(CONFIG_PREFIX) $(INSTALL_OPTS)
29 ifeq ($(strip $(CONFIG_FEATURE_SUID)),y)
32 @echo --------------------------------------------------
33 @echo You will probably need to make your busybox binary
34 @echo setuid root to ensure all configured applets will
36 @echo --------------------------------------------------
40 uninstall: busybox.links
41 rm -f $(CONFIG_PREFIX)/bin/busybox
42 for i in `cat busybox.links` ; do rm -f $(CONFIG_PREFIX)$$i; done
43 ifneq ($(strip $(DO_INSTALL_LIBS)),n)
44 for i in $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS); do \
45 rm -f $(CONFIG_PREFIX)$$i; \
49 # Not very elegant: copies testsuite to objdir...
50 # (cp -pPR is POSIX-compliant (cp -dpR or cp -a would not be))
53 check test: busybox busybox.links
54 test -d $(objtree)/testsuite || cp -pPR $(srctree)/testsuite $(objtree)
55 bindir=$(objtree) srcdir=$(srctree)/testsuite \
56 $(SHELL) -c "cd $(objtree)/testsuite && $(srctree)/testsuite/runtest $(if $(KBUILD_VERBOSE:0=),-v)"
61 rm -r -f busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION); \
62 cp -pPR busybox busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) && { \
63 find busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ -type d \
66 -exec rm -r -f {} \; ; \
67 find busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ -type d \
70 -exec rm -r -f {} \; ; \
71 find busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ -type f \
75 tar -czf busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION).tar.gz \
76 busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ ; }
80 $(Q)$(srctree)/scripts/checkhelp.awk \
81 $(patsubst %,$(srctree)/%,$(wildcard $(patsubst %,%/Config.in,$(busybox-dirs) ./)))
84 sizes: busybox_unstripped
85 $(NM) --size-sort $(<)
88 bloatcheck: busybox_old busybox_unstripped
89 @$(srctree)/scripts/bloat-o-meter busybox_old busybox_unstripped
90 @$(CROSS_COMPILE)size busybox_old busybox_unstripped
93 baseline: busybox_unstripped
94 @mv busybox_unstripped busybox_old
97 objsizes: busybox_unstripped
98 $(srctree)/scripts/objsizes
101 stksizes: busybox_unstripped
102 $(CROSS_COMPILE)objdump -d busybox_unstripped | $(srctree)/scripts/checkstack.pl $(ARCH) | uniq
105 bigdata: busybox_unstripped
106 $(CROSS_COMPILE)nm --size-sort busybox_unstripped | grep -vi ' [trw] '
108 # Documentation Targets
110 doc: docs/busybox.pod docs/BusyBox.txt docs/busybox.1 docs/BusyBox.html
112 # FIXME: Doesn't belong here
114 quiet_cmd_doc = $(Q)echo " DOC $(@F)"
116 disp_doc = $($(quiet)cmd_doc)
118 # sed adds newlines after "Options:" etc,
119 # this is needed in order to get good BusyBox.{1,txt,html}
120 docs/busybox.pod: $(srctree)/docs/busybox_header.pod \
122 $(srctree)/docs/busybox_footer.pod \
127 cat $(srctree)/docs/busybox_header.pod; \
129 applets/usage_pod | sed 's/^[A-Za-z][A-Za-z ]*[a-z]:$$/&\n/'; \
130 cat $(srctree)/docs/busybox_footer.pod; \
133 docs/BusyBox.txt: docs/busybox.pod
136 $(Q)-pod2text $< > $@
138 docs/busybox.1: docs/busybox.pod
141 $(Q)-pod2man --center=busybox --release="version $(KERNELVERSION)" $< > $@
143 docs/BusyBox.html: docs/busybox.net/BusyBox.html
146 $(Q)-rm -f docs/BusyBox.html
147 $(Q)-cp docs/busybox.net/BusyBox.html docs/BusyBox.html
149 docs/busybox.net/BusyBox.html: docs/busybox.pod
150 $(Q)-mkdir -p docs/busybox.net
151 $(Q)-pod2html --noindex $< > $@
154 # documentation, cross-reference
155 # Modern distributions already ship synopsis packages (e.g. debian)
156 # If you have an old distribution go to http://synopsis.fresco.org/
157 syn_tgt = $(wildcard $(patsubst %,%/*.c,$(busybox-alldirs)))
158 syn = $(patsubst %.c, %.syn, $(syn_tgt))
164 SYN_CPPFLAGS := $(strip $(CPPFLAGS) $(EXTRA_CPPFLAGS))
165 SYN_CPPFLAGS := $(subst $(brace_open),\$(brace_open),$(SYN_CPPFLAGS))
166 SYN_CPPFLAGS := $(subst $(brace_close),\$(brace_close),$(SYN_CPPFLAGS))
167 #SYN_CPPFLAGS := $(subst ",\",$(SYN_CPPFLAGS))
169 #SYN_CPPFLAGS := [$(patsubst %,'%'$(comma),$(SYN_CPPFLAGS))'']
172 synopsis -p C -l Comments.SSDFilter,Comments.Previous -Wp,preprocess=True,cppflags="'$(SYN_CPPFLAGS)'" -o $@ $<
176 synopsis -f HTML -Wf,title="'BusyBox Documentation'" -o $@ $^
178 -include $(srctree)/Makefile.local