#--------------------------------------------------------------
noconfig_targets := menuconfig config oldconfig randconfig \
defconfig allyesconfig allnoconfig allbareconfig \
#--------------------------------------------------------------
noconfig_targets := menuconfig config oldconfig randconfig \
defconfig allyesconfig allnoconfig allbareconfig \
@echo ' randconfig - generate a random configuration'
@echo ' release - create a distribution tarball'
@echo ' sizes - show size of all enabled busybox symbols'
@echo ' randconfig - generate a random configuration'
@echo ' release - create a distribution tarball'
@echo ' sizes - show size of all enabled busybox symbols'
scripts/config/conf: scripts/config/Makefile
$(Q)$(MAKE) -C scripts/config conf
-@if [ ! -f .config ] ; then \
scripts/config/conf: scripts/config/Makefile
$(Q)$(MAKE) -C scripts/config conf
-@if [ ! -f .config ] ; then \
fi
scripts/config/mconf: scripts/config/Makefile
$(Q)$(MAKE) -C scripts/config ncurses conf mconf
-@if [ ! -f .config ] ; then \
fi
scripts/config/mconf: scripts/config/Makefile
$(Q)$(MAKE) -C scripts/config ncurses conf mconf
-@if [ ! -f .config ] ; then \
@./scripts/config/conf -o $(CONFIG_CONFIG_IN)
allbareconfig: scripts/config/conf
@./scripts/config/conf -y $(CONFIG_CONFIG_IN)
@./scripts/config/conf -o $(CONFIG_CONFIG_IN)
allbareconfig: scripts/config/conf
@./scripts/config/conf -y $(CONFIG_CONFIG_IN)
- @sed -i -r -e "s/^(USING_CROSS_COMPILER|CONFIG_(DEBUG|STATIC|SELINUX|DEVFSD|NC_GAPING_SECURITY_HOLE|BUILD_AT_ONCE)).*/# \1 is not set/" .config
- @sed -i -e "/FEATURE/s/=.*//;/^[^#]/s/.*FEATURE.*/# \0 is not set/;" .config
+ @$(SED) -i -r -e "s/^(USING_CROSS_COMPILER|CONFIG_(DEBUG|STATIC|SELINUX|DEVFSD|NC_GAPING_SECURITY_HOLE|BUILD_AT_ONCE)).*/# \1 is not set/" .config
+ @$(SED) -i -e "/FEATURE/s/=.*//;/^[^#]/s/.*FEATURE.*/# \0 is not set/;" .config
DO_INSTALL_LIBS:=$(LD_LIBBUSYBOX) \
$(LD_LIBBUSYBOX).$(MAJOR_VERSION) \
$(LD_LIBBUSYBOX).$(MAJOR_VERSION).$(MINOR_VERSION)
DO_INSTALL_LIBS:=$(LD_LIBBUSYBOX) \
$(LD_LIBBUSYBOX).$(MAJOR_VERSION) \
$(LD_LIBBUSYBOX).$(MAJOR_VERSION).$(MINOR_VERSION)
ifeq ($(strip $(CONFIG_BUILD_AT_ONCE)),y)
ifneq ($(strip $(CONFIG_FEATURE_SHARED_BUSYBOX)),y)
ifeq ($(strip $(CONFIG_BUILD_AT_ONCE)),y)
ifneq ($(strip $(CONFIG_FEATURE_SHARED_BUSYBOX)),y)
else # CONFIG_BUILD_AT_ONCE
$(LIBBUSYBOX_SONAME): $(libbusybox-obj)
endif # CONFIG_BUILD_AT_ONCE
else # CONFIG_BUILD_AT_ONCE
$(LIBBUSYBOX_SONAME): $(libbusybox-obj)
endif # CONFIG_BUILD_AT_ONCE
ifeq ($(strip $(CONFIG_FEATURE_SHARED_BUSYBOX)),y)
LDBUSYBOX:=-L$(top_builddir) -lbusybox
ifeq ($(strip $(CONFIG_FEATURE_SHARED_BUSYBOX)),y)
LDBUSYBOX:=-L$(top_builddir) -lbusybox
-Wl,-soname=$(LD_LIBBUSYBOX).$(MAJOR_VERSION) \
-Wl,-z,combreloc $(LIB_LDFLAGS) \
-o $(@) \
-Wl,--start-group -Wl,--whole-archive \
$(LIBRARY_DEFINE) $(^) \
-Wl,--no-whole-archive -Wl,--end-group
-Wl,-soname=$(LD_LIBBUSYBOX).$(MAJOR_VERSION) \
-Wl,-z,combreloc $(LIB_LDFLAGS) \
-o $(@) \
-Wl,--start-group -Wl,--whole-archive \
$(LIBRARY_DEFINE) $(^) \
-Wl,--no-whole-archive -Wl,--end-group
-busybox: .depend $(LIBBUSYBOX_SONAME) $(BUSYBOX_SRC) $(libraries-y)
- $(do_link) $(PROG_CFLAGS) \
+busybox_unstripped: .depend $(LIBBUSYBOX_SONAME) $(BUSYBOX_SRC) $(libraries-y)
+ $(do_link) $(PROG_CFLAGS) $(PROG_LDFLAGS) $(CFLAGS_COMBINE) \
-o $@ -Wl,--start-group \
$(APPLETS_DEFINE) $(APPLET_SRC) \
$(BUSYBOX_DEFINE) $(BUSYBOX_SRC) $(libraries-y) \
$(LDBUSYBOX) $(LIBRARIES) \
-Wl,--end-group
-o $@ -Wl,--start-group \
$(APPLETS_DEFINE) $(APPLET_SRC) \
$(BUSYBOX_DEFINE) $(BUSYBOX_SRC) $(libraries-y) \
$(LDBUSYBOX) $(LIBRARIES) \
-Wl,--end-group
busybox.links: $(top_srcdir)/applets/busybox.mkll include/bb_config.h $(top_srcdir)/include/applets.h
$(Q)-$(SHELL) $^ >$@
install: $(top_srcdir)/applets/install.sh busybox busybox.links
busybox.links: $(top_srcdir)/applets/busybox.mkll include/bb_config.h $(top_srcdir)/include/applets.h
$(Q)-$(SHELL) $^ >$@
install: $(top_srcdir)/applets/install.sh busybox busybox.links
$(SHELL) $< $(PREFIX) $(INSTALL_OPTS)
ifeq ($(strip $(CONFIG_FEATURE_SUID)),y)
@echo
$(SHELL) $< $(PREFIX) $(INSTALL_OPTS)
ifeq ($(strip $(CONFIG_FEATURE_SUID)),y)
@echo
ifneq ($(strip $(DO_INSTALL_LIBS)),n)
for i in $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS); do \
ifneq ($(strip $(DO_INSTALL_LIBS)),n)
for i in $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS); do \
bindir=$(top_builddir) srcdir=$(top_srcdir)/testsuite \
$(top_srcdir)/testsuite/runtest $(CHECK_VERBOSE)
bindir=$(top_builddir) srcdir=$(top_srcdir)/testsuite \
$(top_srcdir)/testsuite/runtest $(CHECK_VERBOSE)
-sizes:
- -$(RM_F) busybox
- $(MAKE) top_srcdir=$(top_srcdir) top_builddir=$(top_builddir) \
- -f $(top_srcdir)/Makefile STRIPCMD=/bin/true
- $(NM) --size-sort busybox
+.PHONY: sizes
+sizes: busybox_unstripped
+ $(NM) --size-sort $(<)
+
+.PHONY: objsizes
+objsizes: busybox_unstripped
+ $(SHELL) $(top_srcdir)/scripts/objsizes
- $(Q)-( cat $(top_srcdir)/docs/busybox_header.pod; \
- $(top_srcdir)/docs/autodocifier.pl $(top_srcdir)/include/usage.h; \
- cat $(top_srcdir)/docs/busybox_footer.pod ) > docs/busybox.pod
+ $(Q)-( cat $(top_srcdir)/docs/busybox_header.pod ; \
+ $(top_srcdir)/docs/autodocifier.pl $(top_srcdir)/include/usage.h ; \
+ cat $(top_srcdir)/docs/busybox_footer.pod ; ) > docs/busybox.pod
$(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)-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
ifeq ($(strip $(CONFIG_BBCONFIG)),y)
DEP_INCLUDES += include/bbconfigopts.h
ifeq ($(strip $(CONFIG_BBCONFIG)),y)
DEP_INCLUDES += include/bbconfigopts.h
+scripts/usage: $(top_srcdir)/scripts/usage.c .config
+ $(do_link.h) -I$(top_srcdir)/include
+
+DEP_INCLUDES += include/usage_compressed.h
+include/usage_compressed.h: .config scripts/usage
+ $(Q)sh $(top_srcdir)/scripts/usage_compressed "$(top_srcdir)/scripts" > $@
+
@if [ ! -x $(top_builddir)/scripts/config/conf ] ; then \
$(MAKE) -C scripts/config conf; \
fi;
@$(top_builddir)/scripts/config/conf -o $(CONFIG_CONFIG_IN)
@if [ ! -x $(top_builddir)/scripts/config/conf ] ; then \
$(MAKE) -C scripts/config conf; \
fi;
@$(top_builddir)/scripts/config/conf -o $(CONFIG_CONFIG_IN)
-include/bb_config.h: include/config.h
- @echo -e "#ifndef BB_CONFIG_H\n#define BB_CONFIG_H" > $@
- @sed -e h -e 's/#undef CONFIG_\(.*\)/#define ENABLE_\1 0/p' -e g \
- -e 's/#undef CONFIG_\(.*\)/#define USE_\1(...)/p' -e g \
- -e 's/#define CONFIG_\([^ ]*\).*/#define ENABLE_\1 1/p' -e g -e \
- 's/#define CONFIG_\([^ ]*\).*/#define USE_\1(...) __VA_ARGS__/p' \
- -e g $< >> $@
- @echo "#endif" >> $@
-
docs/busybox.pod docs/busybox.net/busybox.html \
docs/busybox pod2htm* *.gdb *.elf *~ core .*config.log \
docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html \
docs/busybox.net/BusyBox.html busybox.links \
docs/busybox.pod docs/busybox.net/busybox.html \
docs/busybox pod2htm* *.gdb *.elf *~ core .*config.log \
docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html \
docs/busybox.net/BusyBox.html busybox.links \
- $(DO_INSTALL_LIBS) $(LIBBUSYBOX_SONAME) \
- .config.old busybox
- - rm -rf _install testsuite/links
- - find . -name .\*.flags -exec $(RM_F) {} \;
- - find . -name \*.o -exec $(RM_F) {} \;
- - find . -name \*.a -exec $(RM_F) {} \;
- - find . -name \*.so -exec $(RM_F) {} \;
+ libbusybox.so* \
+ .config.old busybox busybox_unstripped
+ - rm -r -f _install testsuite/links
+ - find . -name .\*.flags -o -name \*.o -o -name \*.om \
+ -o -name \*.os -o -name \*.osm -o -name \*.a | xargs rm -f
- - $(RM_F) scripts/bb_mkdep
- - rm -rf include/config $(DEP_INCLUDES)
- - find . -name .depend -exec $(RM_F) {} \;
- $(RM_F) .config .config.old .config.cmd
+ - rm -f scripts/bb_mkdep
+ - rm -r -f include/config $(DEP_INCLUDES)
+ - find . -name .depend'*' | xargs rm -f
+ rm -f .config .config.old .config.cmd