Use an int to hold the result of fgetc (bug noted by David Kimdon).
[oweals/busybox.git] / Makefile
index 7dbf6575f61cc36df83b2522e6d183c267314fcc..68d7db247a937874f6162f30bf1eb60bfe2b2046 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -69,7 +69,7 @@ DOLFS = false
 
 # If you have a "pristine" source directory, point CONFIG_SRC_DIR to it.
 # Experimental and incomplete; tell the mailing list
-# <busybox@opensource.lineo.com> if you do or don't like it so far.
+# <busybox@busybox.net> if you do or don't like it so far.
 CONFIG_SRC_DIR =
 
 # If you are running a cross compiler, you may want to set CROSS
@@ -111,9 +111,11 @@ export VERSION BUILDTIME TOPDIR HOSTCC HOSTCFLAGS CROSS CC AR AS LD NM STRIP CPP
 # use '-Os' optimization if available, else use -O2
 OPTIMIZATION := ${shell if $(CC) -Os -S -o /dev/null -xc /dev/null \
        >/dev/null 2>&1; then echo "-Os"; else echo "-O2" ; fi}
-
+GCC_STACK_BOUNDRY := ${shell if $(CC) -mpreferred-stack-boundary=2 -S -o /dev/null -xc /dev/null \
+       >/dev/null 2>&1; then echo "-mpreferred-stack-boundary=2"; else echo "" ; fi}
+OPTIMIZATIONS=$(OPTIMIZATION) -fomit-frame-pointer $(GCC_STACK_BOUNDRY)
 WARNINGS=-Wall -Wstrict-prototypes -Wshadow
-CFLAGS = -I $(TOPDIR)/include
+CFLAGS = -I$(TOPDIR)/include
 ARFLAGS = -r
 
 #
@@ -147,9 +149,9 @@ ifeq ($(strip $(DODEBUG)),true)
     LDFLAGS += -Wl,-warn-common
     STRIPCMD    =
 else
-    CFLAGS  += $(WARNINGS) $(OPTIMIZATION) -fomit-frame-pointer -mpreferred-stack-boundary=2 -D_GNU_SOURCE
+    CFLAGS  += $(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE
     LDFLAGS += -s -Wl,-warn-common
-    STRIPCMD    = $(STRIP) --remove-section=.note --remove-section=.comment $(PROG)
+    STRIPCMD    = $(STRIP) --remove-section=.note --remove-section=.comment
 endif
 ifeq ($(strip $(DOSTATIC)),true)
     LDFLAGS += --static
@@ -210,9 +212,9 @@ bbsubdirs: $(patsubst %, _dir_%, $(SUBDIRS))
 $(patsubst %, _dir_%, $(SUBDIRS)) : dummy include/config/MARKER
        $(MAKE) CFLAGS="$(CFLAGS)" -C $(patsubst _dir_%, %, $@)
 
-busybox: config.h depend bbsubdirs
+busybox: config.h dep-files bbsubdirs
        $(CC) $(LDFLAGS) -o $@ applets/busybox.o $(shell find $(SUBDIRS) -name \*.a) $(LIBCONFIG_LIB) $(LIBRARIES)
-       $(STRIPCMD)
+       $(STRIPCMD) $(PROG)
 
 busybox.links: applets/busybox.mkll
        - $(SHELL) $^ >$@
@@ -247,15 +249,15 @@ docs/BusyBox.1: docs/busybox.pod
        - pod2man --center=BusyBox --release="version $(VERSION)" \
                $< > $@
 
-docs/BusyBox.html: docs/busybox.lineo.com/BusyBox.html
+docs/BusyBox.html: docs/busybox.net/BusyBox.html
        - mkdir -p docs
        -@ rm -f docs/BusyBox.html
-       -@ ln -s busybox.lineo.com/BusyBox.html docs/BusyBox.html
+       -@ ln -s busybox.net/BusyBox.html docs/BusyBox.html
 
-docs/busybox.lineo.com/BusyBox.html: docs/busybox.pod
-       -@ mkdir -p docs/busybox.lineo.com
+docs/busybox.net/BusyBox.html: docs/busybox.pod
+       -@ mkdir -p docs/busybox.net
        -  pod2html --noindex $< > \
-           docs/busybox.lineo.com/BusyBox.html
+           docs/busybox.net/BusyBox.html
        -@ rm -f pod2htm*
 
 
@@ -283,7 +285,7 @@ docs/busybox.pdf: docs/busybox.ps
 
 docs/busybox/busyboxdocumentation.html: docs/busybox.sgml
        - mkdir -p docs
-       (cd docs/busybox.lineo.com; sgmltools -b html ../busybox.sgml)
+       (cd docs/busybox.net; sgmltools -b html ../busybox.sgml)
 
 # The nifty new buildsystem stuff
 scripts/mkdep: scripts/mkdep.c
@@ -293,7 +295,7 @@ scripts/split-include: scripts/split-include.c
        $(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c
 
 dep-files: scripts/mkdep
-       if [ ! -f .depend ] ; then \
+       @if [ ! -f .depend ] ; then \
                rm -f .depend .hdepend; \
                mkdir -p $(TOPDIR)/include/config; \
                scripts/mkdep -I $(TOPDIR)/include -- \
@@ -367,9 +369,9 @@ clean:
        - $(MAKE) -C tests clean
        - $(MAKE) -C scripts/lxdialog clean
        - rm -f docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html \
-           docs/busybox.lineo.com/BusyBox.html
+           docs/busybox.net/BusyBox.html
        - rm -f docs/busybox.txt docs/busybox.dvi docs/busybox.ps \
-           docs/busybox.pdf docs/busybox.lineo.com/busybox.html \
+           docs/busybox.pdf docs/busybox.net/busybox.html \
            docs/busybox _install pod2htm* *.gdb *.elf *~ core
        - rm -f busybox.links libbb/loop.h .config.old .hdepend
        - rm -f scripts/split-include scripts/mkdep .*config.log
@@ -401,6 +403,9 @@ dist release: distclean doc
 
 
 
-.PHONY: tags
+.PHONY: tags check
 tags:
        ctags -R .
+
+check: busybox
+       cd testsuite && ./runtest