#
# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Licensed under GPLv2, see the file LICENSE in this tarball for details.
#
#--------------------------------------------------------------
include $(patsubst %,%/Makefile.in, $(SRC_DIRS))
-include $(top_builddir)/.depend
-busybox: $(ALL_MAKEFILES) .depend include/bb_config.h $(libraries-y)
+busybox: $(ALL_MAKEFILES) .depend $(libraries-y)
$(CC) $(LDFLAGS) -o $@ -Wl,--start-group $(libraries-y) $(LIBRARIES) -Wl,--end-group
$(STRIPCMD) $@
bindir=$(top_builddir) srcdir=$(top_srcdir)/testsuite \
$(top_srcdir)/testsuite/runtest
+sizes:
+ -rm -f busybox
+ $(MAKE) top_srcdir=$(top_srcdir) top_builddir=$(top_builddir) \
+ -f $(top_srcdir)/Makefile STRIPCMD=/bin/true
+ nm --size-sort busybox
+
# Documentation Targets
doc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html
-@ rm -f pod2htm*
# The nifty new buildsystem stuff
-scripts/mkdep: $(top_srcdir)/scripts/mkdep.c
- $(HOSTCC) $(HOSTCFLAGS) -o $@ $<
-
-scripts/split-include: $(top_srcdir)/scripts/split-include.c
+scripts/bb_mkdep: $(top_srcdir)/scripts/bb_mkdep.c
$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
depend dep: .depend
-.depend: scripts/mkdep include/config.h include/bbconfigopts.h
- rm -f .depend .hdepend;
- mkdir -p include/config;
- scripts/mkdep -I include -- \
- `find $(top_srcdir) -name \*.c -print | sed -e "s,^./,,"` >> .depend;
- scripts/mkdep -I include -- \
- `find $(top_srcdir) -name \*.h -print | sed -e "s,^./,,"` >> .hdepend;
-
-include/config/MARKER: depend scripts/split-include
- scripts/split-include include/config.h include/config
- @ touch include/config/MARKER
+.depend: scripts/bb_mkdep include/config.h include/bb_config.h
+ @rm -f .depend
+ @mkdir -p include/config
+ scripts/bb_mkdep -c include/config.h -c include/bb_config.h > $@
include/config.h: .config
@if [ ! -x $(top_builddir)/scripts/config/conf ] ; then \
@$(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 's/#undef CONFIG_\(.*\)/#define ENABLE_\1 0/' \
+ @echo -e "#ifndef BB_CONFIG_H\n#define BB_CONFIG_H" > $@
+ @sed -e 's/#undef CONFIG_\(.*\)/#define ENABLE_\1 0/' \
-e 's/#define CONFIG_\(.*\)/#define CONFIG_\1\n#define ENABLE_\1/' \
< $< >> $@
- echo "#endif" >> $@
+ @echo "#endif" >> $@
include/bbconfigopts.h: .config
@[ -d $(@D) ] || mkdir -v $(@D)
allyesconfig: scripts/config/conf
@./scripts/config/conf -y $(CONFIG_CONFIG_IN)
- sed -i -e "s/^CONFIG_DEBUG.*/# CONFIG_DEBUG is not set/" .config
- sed -i -e "s/^USING_CROSS_COMPILER.*/# USING_CROSS_COMPILER is not set/" .config
- sed -i -e "s/^CONFIG_STATIC.*/# CONFIG_STATIC is not set/" .config
- sed -i -e "s/^CONFIG_SELINUX.*/# CONFIG_SELINUX is not set/" .config
+ sed -i -r -e "s/^(CONFIG_DEBUG|USING_CROSS_COMPILER|CONFIG_STATIC|CONFIG_SELINUX).*/# \1 is not set/" .config
@./scripts/config/conf -o $(CONFIG_CONFIG_IN)
allnoconfig: scripts/config/conf
@./scripts/config/conf -d $(CONFIG_CONFIG_IN)
clean:
+ - $(MAKE) -C scripts/config $@
- rm -f docs/busybox.dvi docs/busybox.ps \
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 libbb/loop.h \
- .config.old .hdepend busybox
+ .config.old busybox testsuite/links/*
- rm -rf _install
- find . -name .\*.flags -exec rm -f {} \;
- find . -name \*.o -exec rm -f {} \;
- find . -name \*.a -exec rm -f {} \;
distclean: clean
- - rm -f scripts/split-include scripts/mkdep
+ - rm -f scripts/bb_mkdep
- rm -rf include/config include/config.h include/bb_config.h include/bbconfigopts.h
- find . -name .depend -exec rm -f {} \;
rm -f .config .config.old .config.cmd
- - $(MAKE) -C scripts/config clean
release: distclean #doc
cd ..; \