blob: 13da38e76f006c4c08a136b05ed8469e53504a4f [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
Bernhard Reutner-Fischer193bcf32006-11-17 13:17:04 +00008busybox.links: $(srctree)/applets/busybox.mkll $(objtree)/include/autoconf.h $(srctree)/include/applets.h
Denis Vlasenko7d219aa2006-10-05 10:17:08 +00009 $(Q)-$(SHELL) $^ >$@
10
11.PHONY: install
Bernhard Reutner-Fischer8bfd2152006-11-17 13:54:29 +000012ifeq ($(CONFIG_INSTALL_APPLET_SYMLINKS),y)
13INSTALL_OPTS:= --symlinks
14endif
15ifeq ($(CONFIG_INSTALL_APPLET_HARDLINKS),y)
16INSTALL_OPTS:= --hardlinks
17endif
Denis Vlasenko7d219aa2006-10-05 10:17:08 +000018install: $(srctree)/applets/install.sh busybox busybox.links
19 $(Q)DO_INSTALL_LIBS="$(strip $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS))" \
20 $(SHELL) $< $(CONFIG_PREFIX) $(INSTALL_OPTS)
21ifeq ($(strip $(CONFIG_FEATURE_SUID)),y)
22 @echo
23 @echo
24 @echo --------------------------------------------------
25 @echo You will probably need to make your busybox binary
26 @echo setuid root to ensure all configured applets will
27 @echo work properly.
28 @echo --------------------------------------------------
29 @echo
30endif
31
32uninstall: busybox.links
33 rm -f $(CONFIG_PREFIX)/bin/busybox
34 for i in `cat busybox.links` ; do rm -f $(CONFIG_PREFIX)$$i; done
35ifneq ($(strip $(DO_INSTALL_LIBS)),n)
36 for i in $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS); do \
37 rm -f $(CONFIG_PREFIX)$$i; \
38 done
39endif
40
41check test: busybox
42 bindir=$(objtree) srcdir=$(srctree)/testsuite SED="$(SED)" \
43 $(SHELL) $(srctree)/testsuite/runtest $(if $(KBUILD_VERBOSE:1=),-v)
44
45### checkhelp:
46### $(Q)$(srctree)/scripts/checkhelp.awk \
47### $(wildcard $(patsubst %,%/Config.in,$(SRC_DIRS) ./))
48
49.PHONY: sizes
50sizes: busybox_unstripped
51 $(NM) --size-sort $(<)
52
53.PHONY: bloatcheck
54bloatcheck: busybox_old busybox_unstripped
55 @$(srctree)/scripts/bloat-o-meter busybox_old busybox_unstripped
56
57.PHONY: baseline
58baseline: busybox_unstripped
59 @mv busybox_unstripped busybox_old
60
61.PHONY: objsizes
62objsizes: busybox_unstripped
Denis Vlasenko18684092006-10-05 17:11:08 +000063 $(srctree)/scripts/objsizes
Denis Vlasenko7d219aa2006-10-05 10:17:08 +000064
65# Documentation Targets
66.PHONY: doc
67doc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html
68
69docs/busybox.pod: $(srctree)/docs/busybox_header.pod \
70 $(srctree)/include/usage.h \
71 $(srctree)/docs/busybox_footer.pod \
72 $(srctree)/docs/autodocifier.pl
73 $(disp_doc)
74 $(Q)-mkdir -p docs
75 $(Q)-( cat $(srctree)/docs/busybox_header.pod ; \
76 $(srctree)/docs/autodocifier.pl $(srctree)/include/usage.h ; \
77 cat $(srctree)/docs/busybox_footer.pod ; ) > docs/busybox.pod
78
79docs/BusyBox.txt: docs/busybox.pod
80 $(disp_doc)
81 $(Q)-mkdir -p docs
82 $(Q)-pod2text $< > $@
83
84docs/BusyBox.1: docs/busybox.pod
85 $(disp_doc)
86 $(Q)-mkdir -p docs
87 $(Q)-pod2man --center=BusyBox --release="version $(VERSION)" \
88 $< > $@
89
90docs/BusyBox.html: docs/busybox.net/BusyBox.html
91 $(disp_doc)
92 $(Q)-mkdir -p docs
93 $(Q)-rm -f docs/BusyBox.html
94 $(Q)-cp docs/busybox.net/BusyBox.html docs/BusyBox.html
95
96docs/busybox.net/BusyBox.html: docs/busybox.pod
97 $(Q)-mkdir -p docs/busybox.net
98 $(Q)-pod2html --noindex $< > \
99 docs/busybox.net/BusyBox.html
100 $(Q)-rm -f pod2htm*
101
102# documentation, cross-reference
103# Modern distributions already ship synopsis packages (e.g. debian)
104# If you have an old distribution go to http://synopsis.fresco.org/
105syn_tgt := $(wildcard $(patsubst %,%/*.c,$(SRC_DIRS)))
106syn := $(patsubst %.c, %.syn, $(syn_tgt))
107
108%.syn: %.c
109 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 $@ $<
110
111.PHONY: html
112html: $(syn)
113 synopsis -f HTML -Wf,title="'BusyBox Documentation'" -o $@ $^