Added files to ignore that were missing from the subversion ignore
[people/mcb30/busybox.git] / Makefile.custom
1 # ==========================================================================
2 # Build system
3 # ==========================================================================
4
5 busybox.links: $(srctree)/applets/busybox.mkll $(objtree)/include/autoconf.h $(srctree)/include/applets.h
6         $(Q)-$(SHELL) $^ >$@
7
8 .PHONY: install
9 ifeq ($(CONFIG_INSTALL_APPLET_SYMLINKS),y)
10 INSTALL_OPTS:= --symlinks
11 endif
12 ifeq ($(CONFIG_INSTALL_APPLET_HARDLINKS),y)
13 INSTALL_OPTS:= --hardlinks
14 endif
15 ifeq ($(CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS),y)
16 ifeq ($(CONFIG_INSTALL_SH_APPLET_SYMLINK),y)
17 INSTALL_OPTS:= --sw-sh-sym
18 endif
19 ifeq ($(CONFIG_INSTALL_SH_APPLET_HARDLINK),y)
20 INSTALL_OPTS:= --sw-sh-hard
21 endif
22 ifeq ($(CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER),y)
23 INSTALL_OPTS:= --scriptwrapper
24 endif
25 endif
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)
30         @echo
31         @echo
32         @echo --------------------------------------------------
33         @echo You will probably need to make your busybox binary
34         @echo setuid root to ensure all configured applets will
35         @echo work properly.
36         @echo --------------------------------------------------
37         @echo
38 endif
39
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; \
46         done
47 endif
48
49 check test: busybox busybox.links
50         bindir=$(objtree) srcdir=$(srctree)/testsuite SED="$(SED)" \
51         $(SHELL) $(srctree)/testsuite/runtest $(if $(KBUILD_VERBOSE:0=),-v)
52
53 .PHONY: release
54 release: distclean
55         cd ..; \
56         rm -r -f busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION); \
57         cp -a busybox busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) && { \
58         find busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ -type d \
59                 -name .svn \
60                 -print \
61                 -exec rm -r -f {} \; ; \
62         find busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ -type f \
63                 -name .\#* \
64                 -print \
65                 -exec rm -f {} \; ; \
66         tar -czf busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION).tar.gz \
67                 busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ ; }
68
69 .PHONY: checkhelp
70 checkhelp:
71         $(Q)$(srctree)/scripts/checkhelp.awk \
72                 $(patsubst %,$(srctree)/%,$(wildcard $(patsubst %,%/Config.in,$(busybox-dirs) ./)))
73
74 .PHONY: sizes
75 sizes: busybox_unstripped
76         $(NM) --size-sort $(<)
77
78 .PHONY: bloatcheck
79 bloatcheck: busybox_old busybox_unstripped
80         @$(srctree)/scripts/bloat-o-meter busybox_old busybox_unstripped
81         @$(CROSS_COMPILE)size busybox_old busybox_unstripped
82
83 .PHONY: baseline
84 baseline: busybox_unstripped
85         @mv busybox_unstripped busybox_old
86
87 .PHONY: objsizes
88 objsizes: busybox_unstripped
89         $(srctree)/scripts/objsizes
90
91 .PHONY: stksizes
92 stksizes: busybox_unstripped
93         $(CROSS_COMPILE)objdump -d busybox_unstripped | $(srctree)/scripts/checkstack.pl $(ARCH)
94
95 .PHONY: bigdata
96 bigdata: busybox_unstripped
97         $(CROSS_COMPILE)nm --size-sort busybox_unstripped | grep -vi ' [tr] '
98
99 # Documentation Targets
100 .PHONY: doc
101 doc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html
102
103 docs/busybox.pod: $(srctree)/docs/busybox_header.pod \
104                 $(srctree)/include/usage.h \
105                 $(srctree)/docs/busybox_footer.pod \
106                 $(srctree)/docs/autodocifier.pl
107         $(disp_doc)
108         $(Q)-mkdir -p docs
109         $(Q)-( cat $(srctree)/docs/busybox_header.pod ; \
110             $(srctree)/docs/autodocifier.pl $(srctree)/include/usage.h ; \
111             cat $(srctree)/docs/busybox_footer.pod ; ) > docs/busybox.pod
112
113 docs/BusyBox.txt: docs/busybox.pod
114         $(disp_doc)
115         $(Q)-mkdir -p docs
116         $(Q)-pod2text $< > $@
117
118 docs/BusyBox.1: docs/busybox.pod
119         $(disp_doc)
120         $(Q)-mkdir -p docs
121         $(Q)-pod2man --center=BusyBox --release="version $(VERSION)" \
122                 $< > $@
123
124 docs/BusyBox.html: docs/busybox.net/BusyBox.html
125         $(disp_doc)
126         $(Q)-mkdir -p docs
127         $(Q)-rm -f docs/BusyBox.html
128         $(Q)-cp docs/busybox.net/BusyBox.html docs/BusyBox.html
129
130 docs/busybox.net/BusyBox.html: docs/busybox.pod
131         $(Q)-mkdir -p docs/busybox.net
132         $(Q)-pod2html --noindex $< > \
133             docs/busybox.net/BusyBox.html
134         $(Q)-rm -f pod2htm*
135
136 # documentation, cross-reference
137 # Modern distributions already ship synopsis packages (e.g. debian)
138 # If you have an old distribution go to http://synopsis.fresco.org/
139 syn_tgt = $(wildcard $(patsubst %,%/*.c,$(busybox-alldirs)))
140 syn     = $(patsubst %.c, %.syn, $(syn_tgt))
141
142 comma:= ,
143 brace_open:= (
144 brace_close:= )
145
146 SYN_CPPFLAGS := $(strip $(CPPFLAGS) $(EXTRA_CPPFLAGS))
147 SYN_CPPFLAGS := $(subst $(brace_open),\$(brace_open),$(SYN_CPPFLAGS))
148 SYN_CPPFLAGS := $(subst $(brace_close),\$(brace_close),$(SYN_CPPFLAGS))
149 #SYN_CPPFLAGS := $(subst ",\",$(SYN_CPPFLAGS))
150 #")
151 #SYN_CPPFLAGS := [$(patsubst %,'%'$(comma),$(SYN_CPPFLAGS))'']
152
153 %.syn: %.c
154         synopsis -p C -l Comments.SSDFilter,Comments.Previous -Wp,preprocess=True,cppflags="'$(SYN_CPPFLAGS)'" -o $@ $<
155
156 .PHONY: html
157 html: $(syn)
158         synopsis -f HTML -Wf,title="'BusyBox Documentation'" -o $@ $^
159
160 -include $(srctree)/Makefile.local