2006-10-10 01:17:38 +05:30
|
|
|
# ==========================================================================
|
|
|
|
# Build system
|
|
|
|
# ==========================================================================
|
2006-10-05 15:47:08 +05:30
|
|
|
|
|
|
|
%.bflt: %_unstripped
|
|
|
|
$(CROSS_COMPILE)elf2flt $(ELF2FLTFLAGS) $< -o $@
|
|
|
|
|
2006-11-17 18:47:04 +05:30
|
|
|
busybox.links: $(srctree)/applets/busybox.mkll $(objtree)/include/autoconf.h $(srctree)/include/applets.h
|
2006-10-05 15:47:08 +05:30
|
|
|
$(Q)-$(SHELL) $^ >$@
|
|
|
|
|
|
|
|
.PHONY: install
|
2006-11-17 19:24:29 +05:30
|
|
|
ifeq ($(CONFIG_INSTALL_APPLET_SYMLINKS),y)
|
|
|
|
INSTALL_OPTS:= --symlinks
|
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_INSTALL_APPLET_HARDLINKS),y)
|
|
|
|
INSTALL_OPTS:= --hardlinks
|
|
|
|
endif
|
2006-10-05 15:47:08 +05:30
|
|
|
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
|
|
|
|
|
2007-01-28 03:34:58 +05:30
|
|
|
check test: busybox busybox.links
|
2006-10-05 15:47:08 +05:30
|
|
|
bindir=$(objtree) srcdir=$(srctree)/testsuite SED="$(SED)" \
|
2007-01-28 03:34:58 +05:30
|
|
|
$(SHELL) $(srctree)/testsuite/runtest $(if $(KBUILD_VERBOSE:0=),-v)
|
2006-10-05 15:47:08 +05:30
|
|
|
|
2006-12-13 04:01:15 +05:30
|
|
|
.PHONY: release
|
|
|
|
release: distclean
|
|
|
|
cd ..; \
|
|
|
|
rm -r -f busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION); \
|
2006-12-13 05:16:31 +05:30
|
|
|
cp -a busybox busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) && { \
|
2006-12-13 04:01:15 +05:30
|
|
|
find busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ -type d \
|
|
|
|
-name .svn \
|
|
|
|
-print \
|
2006-12-13 05:16:31 +05:30
|
|
|
-exec rm -r -f {} \; ; \
|
2006-12-13 04:01:15 +05:30
|
|
|
find busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ -type f \
|
|
|
|
-name .\#* \
|
|
|
|
-print \
|
2006-12-13 05:16:31 +05:30
|
|
|
-exec rm -f {} \; ; \
|
2006-12-13 04:01:15 +05:30
|
|
|
tar -czf busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION).tar.gz \
|
2006-12-13 05:16:31 +05:30
|
|
|
busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ ; }
|
2006-12-13 04:01:15 +05:30
|
|
|
|
2006-11-22 15:09:48 +05:30
|
|
|
.PHONY: checkhelp
|
|
|
|
checkhelp:
|
|
|
|
$(Q)$(srctree)/scripts/checkhelp.awk \
|
|
|
|
$(patsubst %,$(srctree)/%,$(wildcard $(patsubst %,%/Config.in,$(busybox-dirs) ./)))
|
2006-10-05 15:47:08 +05:30
|
|
|
|
|
|
|
.PHONY: sizes
|
|
|
|
sizes: busybox_unstripped
|
|
|
|
$(NM) --size-sort $(<)
|
|
|
|
|
|
|
|
.PHONY: bloatcheck
|
|
|
|
bloatcheck: busybox_old busybox_unstripped
|
|
|
|
@$(srctree)/scripts/bloat-o-meter busybox_old busybox_unstripped
|
|
|
|
|
|
|
|
.PHONY: baseline
|
|
|
|
baseline: busybox_unstripped
|
|
|
|
@mv busybox_unstripped busybox_old
|
|
|
|
|
|
|
|
.PHONY: objsizes
|
|
|
|
objsizes: busybox_unstripped
|
2006-10-05 22:41:08 +05:30
|
|
|
$(srctree)/scripts/objsizes
|
2006-10-05 15:47:08 +05:30
|
|
|
|
2007-06-10 06:24:27 +05:30
|
|
|
.PHONY: stksizes
|
|
|
|
stksizes: busybox_unstripped
|
|
|
|
$(CROSS_COMPILE)objdump -d busybox_unstripped | $(srctree)/scripts/checkstack.pl $(ARCH)
|
|
|
|
|
2006-12-01 02:11:28 +05:30
|
|
|
.PHONY: bigdata
|
|
|
|
bigdata: busybox_unstripped
|
2007-06-10 06:24:27 +05:30
|
|
|
$(CROSS_COMPILE)nm --size-sort busybox_unstripped | grep -vi ' [tr] '
|
2006-12-01 02:11:28 +05:30
|
|
|
|
2006-10-05 15:47:08 +05:30
|
|
|
# Documentation Targets
|
|
|
|
.PHONY: doc
|
|
|
|
doc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html
|
|
|
|
|
|
|
|
docs/busybox.pod: $(srctree)/docs/busybox_header.pod \
|
|
|
|
$(srctree)/include/usage.h \
|
|
|
|
$(srctree)/docs/busybox_footer.pod \
|
|
|
|
$(srctree)/docs/autodocifier.pl
|
|
|
|
$(disp_doc)
|
|
|
|
$(Q)-mkdir -p docs
|
|
|
|
$(Q)-( cat $(srctree)/docs/busybox_header.pod ; \
|
|
|
|
$(srctree)/docs/autodocifier.pl $(srctree)/include/usage.h ; \
|
|
|
|
cat $(srctree)/docs/busybox_footer.pod ; ) > docs/busybox.pod
|
|
|
|
|
|
|
|
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
|
|
|
|
$(Q)-pod2man --center=BusyBox --release="version $(VERSION)" \
|
|
|
|
$< > $@
|
|
|
|
|
|
|
|
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
|
|
|
|
$(Q)-pod2html --noindex $< > \
|
|
|
|
docs/busybox.net/BusyBox.html
|
|
|
|
$(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 20:59:00 +05:30
|
|
|
syn_tgt = $(wildcard $(patsubst %,%/*.c,$(busybox-alldirs)))
|
|
|
|
syn = $(patsubst %.c, %.syn, $(syn_tgt))
|
2006-10-05 15:47:08 +05:30
|
|
|
|
2006-12-07 03:21:59 +05:30
|
|
|
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 15:47:08 +05:30
|
|
|
%.syn: %.c
|
2006-12-07 03:21:59 +05:30
|
|
|
synopsis -p C -l Comments.SSDFilter,Comments.Previous -Wp,preprocess=True,cppflags="'$(SYN_CPPFLAGS)'" -o $@ $<
|
2006-10-05 15:47:08 +05:30
|
|
|
|
|
|
|
.PHONY: html
|
|
|
|
html: $(syn)
|
|
|
|
synopsis -f HTML -Wf,title="'BusyBox Documentation'" -o $@ $^
|
2007-05-03 03:37:03 +05:30
|
|
|
|
|
|
|
-include $(srctree)/Makefile.local
|