2006-10-09 19:47:38 +00:00
|
|
|
# ==========================================================================
|
|
|
|
# Build system
|
|
|
|
# ==========================================================================
|
2006-10-05 10:17:08 +00:00
|
|
|
|
2006-11-17 13:17:04 +00:00
|
|
|
busybox.links: $(srctree)/applets/busybox.mkll $(objtree)/include/autoconf.h $(srctree)/include/applets.h
|
2006-10-05 10:17:08 +00:00
|
|
|
$(Q)-$(SHELL) $^ >$@
|
|
|
|
|
|
|
|
.PHONY: install
|
2006-11-17 13:54:29 +00:00
|
|
|
ifeq ($(CONFIG_INSTALL_APPLET_SYMLINKS),y)
|
|
|
|
INSTALL_OPTS:= --symlinks
|
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_INSTALL_APPLET_HARDLINKS),y)
|
|
|
|
INSTALL_OPTS:= --hardlinks
|
|
|
|
endif
|
2007-08-25 18:25:24 +00:00
|
|
|
ifeq ($(CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS),y)
|
|
|
|
ifeq ($(CONFIG_INSTALL_SH_APPLET_SYMLINK),y)
|
|
|
|
INSTALL_OPTS:= --sw-sh-sym
|
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_INSTALL_SH_APPLET_HARDLINK),y)
|
|
|
|
INSTALL_OPTS:= --sw-sh-hard
|
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER),y)
|
|
|
|
INSTALL_OPTS:= --scriptwrapper
|
|
|
|
endif
|
|
|
|
endif
|
2006-10-05 10:17:08 +00:00
|
|
|
install: $(srctree)/applets/install.sh busybox busybox.links
|
|
|
|
$(Q)DO_INSTALL_LIBS="$(strip $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS))" \
|
|
|
|
$(SHELL) $< $(CONFIG_PREFIX) $(INSTALL_OPTS)
|
|
|
|
ifeq ($(strip $(CONFIG_FEATURE_SUID)),y)
|
|
|
|
@echo
|
|
|
|
@echo
|
|
|
|
@echo --------------------------------------------------
|
|
|
|
@echo You will probably need to make your busybox binary
|
|
|
|
@echo setuid root to ensure all configured applets will
|
|
|
|
@echo work properly.
|
|
|
|
@echo --------------------------------------------------
|
|
|
|
@echo
|
|
|
|
endif
|
|
|
|
|
|
|
|
uninstall: busybox.links
|
|
|
|
rm -f $(CONFIG_PREFIX)/bin/busybox
|
|
|
|
for i in `cat busybox.links` ; do rm -f $(CONFIG_PREFIX)$$i; done
|
|
|
|
ifneq ($(strip $(DO_INSTALL_LIBS)),n)
|
|
|
|
for i in $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS); do \
|
|
|
|
rm -f $(CONFIG_PREFIX)$$i; \
|
|
|
|
done
|
|
|
|
endif
|
|
|
|
|
2008-04-10 19:59:20 +00:00
|
|
|
# Not very elegant: copies testsuite to objdir...
|
2008-04-11 10:54:37 +00:00
|
|
|
# (cp -pPR is POSIX-compliant (cp -dpR or cp -a would not be))
|
2008-04-10 19:59:20 +00:00
|
|
|
.PHONY: check
|
|
|
|
.PHONY: test
|
2007-01-27 22:04:58 +00:00
|
|
|
check test: busybox busybox.links
|
2008-04-11 10:54:37 +00:00
|
|
|
test -d $(objtree)/testsuite || cp -pPR $(srctree)/testsuite $(objtree)
|
2008-04-10 19:59:20 +00:00
|
|
|
bindir=$(objtree) srcdir=$(srctree)/testsuite \
|
|
|
|
$(SHELL) -c "cd $(objtree)/testsuite && $(srctree)/testsuite/runtest $(if $(KBUILD_VERBOSE:0=),-v)"
|
2006-10-05 10:17:08 +00:00
|
|
|
|
2006-12-12 22:31:15 +00:00
|
|
|
.PHONY: release
|
|
|
|
release: distclean
|
|
|
|
cd ..; \
|
|
|
|
rm -r -f busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION); \
|
2008-04-11 10:54:37 +00:00
|
|
|
cp -pPR busybox busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) && { \
|
2006-12-12 22:31:15 +00:00
|
|
|
find busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ -type d \
|
|
|
|
-name .svn \
|
|
|
|
-print \
|
2006-12-12 23:46:31 +00:00
|
|
|
-exec rm -r -f {} \; ; \
|
2006-12-12 22:31:15 +00:00
|
|
|
find busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ -type f \
|
|
|
|
-name .\#* \
|
|
|
|
-print \
|
2006-12-12 23:46:31 +00:00
|
|
|
-exec rm -f {} \; ; \
|
2006-12-12 22:31:15 +00:00
|
|
|
tar -czf busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION).tar.gz \
|
2006-12-12 23:46:31 +00:00
|
|
|
busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ ; }
|
2006-12-12 22:31:15 +00:00
|
|
|
|
2006-11-22 09:39:48 +00:00
|
|
|
.PHONY: checkhelp
|
|
|
|
checkhelp:
|
|
|
|
$(Q)$(srctree)/scripts/checkhelp.awk \
|
|
|
|
$(patsubst %,$(srctree)/%,$(wildcard $(patsubst %,%/Config.in,$(busybox-dirs) ./)))
|
2006-10-05 10:17:08 +00:00
|
|
|
|
|
|
|
.PHONY: sizes
|
|
|
|
sizes: busybox_unstripped
|
|
|
|
$(NM) --size-sort $(<)
|
|
|
|
|
|
|
|
.PHONY: bloatcheck
|
|
|
|
bloatcheck: busybox_old busybox_unstripped
|
|
|
|
@$(srctree)/scripts/bloat-o-meter busybox_old busybox_unstripped
|
2007-06-21 12:43:45 +00:00
|
|
|
@$(CROSS_COMPILE)size busybox_old busybox_unstripped
|
2006-10-05 10:17:08 +00:00
|
|
|
|
|
|
|
.PHONY: baseline
|
|
|
|
baseline: busybox_unstripped
|
|
|
|
@mv busybox_unstripped busybox_old
|
|
|
|
|
|
|
|
.PHONY: objsizes
|
|
|
|
objsizes: busybox_unstripped
|
2006-10-05 17:11:08 +00:00
|
|
|
$(srctree)/scripts/objsizes
|
2006-10-05 10:17:08 +00:00
|
|
|
|
2007-06-10 00:54:27 +00:00
|
|
|
.PHONY: stksizes
|
|
|
|
stksizes: busybox_unstripped
|
2007-12-02 08:35:37 +00:00
|
|
|
$(CROSS_COMPILE)objdump -d busybox_unstripped | $(srctree)/scripts/checkstack.pl $(ARCH) | uniq
|
2007-06-10 00:54:27 +00:00
|
|
|
|
2006-11-30 20:41:28 +00:00
|
|
|
.PHONY: bigdata
|
|
|
|
bigdata: busybox_unstripped
|
2008-05-20 06:31:56 +00:00
|
|
|
$(CROSS_COMPILE)nm --size-sort busybox_unstripped | grep -vi ' [trw] '
|
2006-11-30 20:41:28 +00:00
|
|
|
|
2006-10-05 10:17:08 +00:00
|
|
|
# Documentation Targets
|
|
|
|
.PHONY: doc
|
|
|
|
doc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html
|
|
|
|
|
2008-08-21 21:15:28 +00:00
|
|
|
# FIXME: Doesn't belong here
|
2009-03-30 05:26:34 +00:00
|
|
|
cmd_doc =
|
|
|
|
quiet_cmd_doc = $(Q)echo " DOC $(@F)"
|
|
|
|
silent_cmd_doc =
|
|
|
|
disp_doc = $($(quiet)cmd_doc)
|
2008-08-21 21:15:28 +00:00
|
|
|
|
2009-10-01 23:10:32 +00:00
|
|
|
# sed adds newlines after "Options:" etc,
|
|
|
|
# this is needed in order to get good BusyBox.{1,txt,html}
|
2006-10-05 10:17:08 +00:00
|
|
|
docs/busybox.pod: $(srctree)/docs/busybox_header.pod \
|
|
|
|
$(srctree)/include/usage.h \
|
|
|
|
$(srctree)/docs/busybox_footer.pod \
|
2009-10-01 23:10:32 +00:00
|
|
|
applets/usage_pod
|
2006-10-05 10:17:08 +00:00
|
|
|
$(disp_doc)
|
|
|
|
$(Q)-mkdir -p docs
|
2009-10-01 23:10:32 +00:00
|
|
|
$(Q)-( \
|
|
|
|
cat $(srctree)/docs/busybox_header.pod; \
|
|
|
|
applets/usage_pod | sed 's/^[A-Za-z][A-Za-z ]*[a-z]:$$/&\n/'; \
|
|
|
|
cat $(srctree)/docs/busybox_footer.pod; \
|
|
|
|
) > docs/busybox.pod
|
2006-10-05 10:17:08 +00:00
|
|
|
|
|
|
|
docs/BusyBox.txt: docs/busybox.pod
|
|
|
|
$(disp_doc)
|
|
|
|
$(Q)-mkdir -p docs
|
|
|
|
$(Q)-pod2text $< > $@
|
|
|
|
|
|
|
|
docs/BusyBox.1: docs/busybox.pod
|
|
|
|
$(disp_doc)
|
|
|
|
$(Q)-mkdir -p docs
|
2009-10-02 09:37:17 +00:00
|
|
|
$(Q)-pod2man --center=BusyBox --release="version $(KERNELVERSION)" $< > $@
|
2006-10-05 10:17:08 +00:00
|
|
|
|
|
|
|
docs/BusyBox.html: docs/busybox.net/BusyBox.html
|
|
|
|
$(disp_doc)
|
|
|
|
$(Q)-mkdir -p docs
|
|
|
|
$(Q)-rm -f docs/BusyBox.html
|
|
|
|
$(Q)-cp docs/busybox.net/BusyBox.html docs/BusyBox.html
|
|
|
|
|
|
|
|
docs/busybox.net/BusyBox.html: docs/busybox.pod
|
|
|
|
$(Q)-mkdir -p docs/busybox.net
|
2009-10-01 23:10:32 +00:00
|
|
|
$(Q)-pod2html --noindex $< > $@
|
2006-10-05 10:17:08 +00:00
|
|
|
$(Q)-rm -f pod2htm*
|
|
|
|
|
|
|
|
# documentation, cross-reference
|
|
|
|
# Modern distributions already ship synopsis packages (e.g. debian)
|
|
|
|
# If you have an old distribution go to http://synopsis.fresco.org/
|
2006-12-06 15:29:00 +00:00
|
|
|
syn_tgt = $(wildcard $(patsubst %,%/*.c,$(busybox-alldirs)))
|
|
|
|
syn = $(patsubst %.c, %.syn, $(syn_tgt))
|
2006-10-05 10:17:08 +00:00
|
|
|
|
2006-12-06 21:51:59 +00:00
|
|
|
comma:= ,
|
|
|
|
brace_open:= (
|
|
|
|
brace_close:= )
|
|
|
|
|
|
|
|
SYN_CPPFLAGS := $(strip $(CPPFLAGS) $(EXTRA_CPPFLAGS))
|
|
|
|
SYN_CPPFLAGS := $(subst $(brace_open),\$(brace_open),$(SYN_CPPFLAGS))
|
|
|
|
SYN_CPPFLAGS := $(subst $(brace_close),\$(brace_close),$(SYN_CPPFLAGS))
|
|
|
|
#SYN_CPPFLAGS := $(subst ",\",$(SYN_CPPFLAGS))
|
|
|
|
#")
|
|
|
|
#SYN_CPPFLAGS := [$(patsubst %,'%'$(comma),$(SYN_CPPFLAGS))'']
|
|
|
|
|
2006-10-05 10:17:08 +00:00
|
|
|
%.syn: %.c
|
2006-12-06 21:51:59 +00:00
|
|
|
synopsis -p C -l Comments.SSDFilter,Comments.Previous -Wp,preprocess=True,cppflags="'$(SYN_CPPFLAGS)'" -o $@ $<
|
2006-10-05 10:17:08 +00:00
|
|
|
|
|
|
|
.PHONY: html
|
|
|
|
html: $(syn)
|
|
|
|
synopsis -f HTML -Wf,title="'BusyBox Documentation'" -o $@ $^
|
2007-05-02 22:07:03 +00:00
|
|
|
|
|
|
|
-include $(srctree)/Makefile.local
|