blob: 1733232e0a2c9bcd5ed6957b48f84373d2dda8d3 [file] [log] [blame]
Denis Vlasenkoda8f43f2006-10-09 19:47:38 +00001# ==========================================================================
2# Build system
3# ==========================================================================
Denis Vlasenko7d219aa2006-10-05 10:17:08 +00004
5%.bflt: %_unstripped
6 $(CROSS_COMPILE)elf2flt $(ELF2FLTFLAGS) $< -o $@
7
8busybox.links: $(srctree)/applets/busybox.mkll include/bb_config.h $(srctree)/include/applets.h
9 $(Q)-$(SHELL) $^ >$@
10
11.PHONY: install
12install: $(srctree)/applets/install.sh busybox busybox.links
13 $(Q)DO_INSTALL_LIBS="$(strip $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS))" \
14 $(SHELL) $< $(CONFIG_PREFIX) $(INSTALL_OPTS)
15ifeq ($(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
24endif
25
26uninstall: busybox.links
27 rm -f $(CONFIG_PREFIX)/bin/busybox
28 for i in `cat busybox.links` ; do rm -f $(CONFIG_PREFIX)$$i; done
29ifneq ($(strip $(DO_INSTALL_LIBS)),n)
30 for i in $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS); do \
31 rm -f $(CONFIG_PREFIX)$$i; \
32 done
33endif
34
35check 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
44sizes: busybox_unstripped
45 $(NM) --size-sort $(<)
46
47.PHONY: bloatcheck
48bloatcheck: busybox_old busybox_unstripped
49 @$(srctree)/scripts/bloat-o-meter busybox_old busybox_unstripped
50
51.PHONY: baseline
52baseline: busybox_unstripped
53 @mv busybox_unstripped busybox_old
54
55.PHONY: objsizes
56objsizes: busybox_unstripped
Denis Vlasenko18684092006-10-05 17:11:08 +000057 $(srctree)/scripts/objsizes
Denis Vlasenko7d219aa2006-10-05 10:17:08 +000058
59# Documentation Targets
60.PHONY: doc
61doc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html
62
63docs/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
73docs/BusyBox.txt: docs/busybox.pod
74 $(disp_doc)
75 $(Q)-mkdir -p docs
76 $(Q)-pod2text $< > $@
77
78docs/BusyBox.1: docs/busybox.pod
79 $(disp_doc)
80 $(Q)-mkdir -p docs
81 $(Q)-pod2man --center=BusyBox --release="version $(VERSION)" \
82 $< > $@
83
84docs/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
90docs/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/
99syn_tgt := $(wildcard $(patsubst %,%/*.c,$(SRC_DIRS)))
100syn := $(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
106html: $(syn)
107 synopsis -f HTML -Wf,title="'BusyBox Documentation'" -o $@ $^