mirror of
https://github.com/topjohnwu/ndk-busybox.git
synced 2024-12-13 23:08:53 +00:00
ab801874f8
-mkfs_minix_main [busybox_unstripped]: 4288 -mkfs_minix_main [busybox_unstripped]: 4276 -grave [busybox_unstripped]: 4260 (bzip2 users too - not listed) price we pay in code size increase: mainSort 2458 2515 +57 grave 1005 1058 +53 sendMTFValues 2177 2195 +18 BZ2_blockSort 122 125 +3 mkfs_minix_main 3070 3022 -48 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/1 up/down: 131/-48) Total: 83 bytes
161 lines
5.0 KiB
Makefile
161 lines
5.0 KiB
Makefile
# ==========================================================================
|
|
# Build system
|
|
# ==========================================================================
|
|
|
|
busybox.links: $(srctree)/applets/busybox.mkll $(objtree)/include/autoconf.h $(srctree)/include/applets.h
|
|
$(Q)-$(SHELL) $^ >$@
|
|
|
|
.PHONY: install
|
|
ifeq ($(CONFIG_INSTALL_APPLET_SYMLINKS),y)
|
|
INSTALL_OPTS:= --symlinks
|
|
endif
|
|
ifeq ($(CONFIG_INSTALL_APPLET_HARDLINKS),y)
|
|
INSTALL_OPTS:= --hardlinks
|
|
endif
|
|
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
|
|
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
|
|
|
|
check test: busybox busybox.links
|
|
bindir=$(objtree) srcdir=$(srctree)/testsuite SED="$(SED)" \
|
|
$(SHELL) $(srctree)/testsuite/runtest $(if $(KBUILD_VERBOSE:0=),-v)
|
|
|
|
.PHONY: release
|
|
release: distclean
|
|
cd ..; \
|
|
rm -r -f busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION); \
|
|
cp -a busybox busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) && { \
|
|
find busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ -type d \
|
|
-name .svn \
|
|
-print \
|
|
-exec rm -r -f {} \; ; \
|
|
find busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ -type f \
|
|
-name .\#* \
|
|
-print \
|
|
-exec rm -f {} \; ; \
|
|
tar -czf busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION).tar.gz \
|
|
busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ ; }
|
|
|
|
.PHONY: checkhelp
|
|
checkhelp:
|
|
$(Q)$(srctree)/scripts/checkhelp.awk \
|
|
$(patsubst %,$(srctree)/%,$(wildcard $(patsubst %,%/Config.in,$(busybox-dirs) ./)))
|
|
|
|
.PHONY: sizes
|
|
sizes: busybox_unstripped
|
|
$(NM) --size-sort $(<)
|
|
|
|
.PHONY: bloatcheck
|
|
bloatcheck: busybox_old busybox_unstripped
|
|
@$(srctree)/scripts/bloat-o-meter busybox_old busybox_unstripped
|
|
@$(CROSS_COMPILE)size busybox_old busybox_unstripped
|
|
|
|
.PHONY: baseline
|
|
baseline: busybox_unstripped
|
|
@mv busybox_unstripped busybox_old
|
|
|
|
.PHONY: objsizes
|
|
objsizes: busybox_unstripped
|
|
$(srctree)/scripts/objsizes
|
|
|
|
.PHONY: stksizes
|
|
stksizes: busybox_unstripped
|
|
$(CROSS_COMPILE)objdump -d busybox_unstripped | $(srctree)/scripts/checkstack.pl $(ARCH) | uniq
|
|
|
|
.PHONY: bigdata
|
|
bigdata: busybox_unstripped
|
|
$(CROSS_COMPILE)nm --size-sort busybox_unstripped | grep -vi ' [tr] '
|
|
|
|
# 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/
|
|
syn_tgt = $(wildcard $(patsubst %,%/*.c,$(busybox-alldirs)))
|
|
syn = $(patsubst %.c, %.syn, $(syn_tgt))
|
|
|
|
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))'']
|
|
|
|
%.syn: %.c
|
|
synopsis -p C -l Comments.SSDFilter,Comments.Previous -Wp,preprocess=True,cppflags="'$(SYN_CPPFLAGS)'" -o $@ $<
|
|
|
|
.PHONY: html
|
|
html: $(syn)
|
|
synopsis -f HTML -Wf,title="'BusyBox Documentation'" -o $@ $^
|
|
|
|
-include $(srctree)/Makefile.local
|