Fixed 'ls -s' so it actually displays block sizes again.
[oweals/busybox.git] / Makefile
index d5587ae4fe42d8151e33209322c954e3f1ae2b6b..b1f88aa9c9862c1beb85013913bfa4e3d91ac345 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,6 @@
 # Makefile for busybox
 #
-# Copyright (C) 1999-2000 Erik Andersen <andersee@debian.org>
-# Copyright (C) 2000 Karl M. Hegbloom <karlheg@debian.org>
+# Copyright (C) 1999,2000,2001 Erik Andersen <andersee@debian.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
@@ -19,7 +18,7 @@
 #
 
 PROG      := busybox
-VERSION   := 0.49pre
+VERSION   := 0.50pre
 BUILDTIME := $(shell TZ=UTC date --utc "+%Y.%m.%d-%H:%M%z")
 export VERSION
 
@@ -81,21 +80,16 @@ CROSS =
 CC = $(CROSS)gcc
 STRIPTOOL = $(CROSS)strip
 
-# To compile vs an alternative libc, you may need to use/adjust
-# the following lines to meet your needs.  This is how I make
-# busybox compile staticly with uClibc (needs BB_FEATURE_NFSMOUNT
-# disabled at the moment).  Note the _full_ path for LIBCDIR.
-# This is because make doesn't do ~ expansion...
-#LIBCDIR=/home/andersen/CVS/uClibc
-#LDFLAGS+=-nostdlib
-#LIBRARIES = $(LIBCDIR)/libc.a -lgcc
-#CROSS_CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(GCCINCDIR)
-#GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
+# To compile vs uClibc, just use the compiler wrapper built by uClibc...
+# Isn't that easy?  Right now, uClibc needs BB_FEATURE_NFSMOUNT disabled 
+# since uClibc's nfs support isn't ready yet.
+#CC = ../uClibc/extra/gcc-uClibc/gcc-uClibc-i386
 
-# This is how I compile with the uClibc shared lib...
-#LIBCDIR=/home/andersen/CVS/uClibc
+# To compile vs some other alternative libc, you may need to use/adjust
+# the following lines to meet your needs...
+#LIBCDIR=/usr/i486-linuxlibc1/
 #LDFLAGS+=-nostdlib
-#LIBRARIES = -luClibc -lgcc $(LIBCDIR)/crt0.o
+#LIBRARIES = $(LIBCDIR)/libc.a -lgcc
 #CROSS_CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(GCCINCDIR)
 #GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
 
@@ -107,18 +101,18 @@ OPTIMIZATION = $(shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&
 
 WARNINGS = -Wall
 
-ifeq ($(DOLFS),true)
+ifeq ($(strip $(DOLFS)),true)
     # For large file summit support
     CFLAGS+=-D_FILE_OFFSET_BITS=64
 endif
-ifeq ($(DODMALLOC),true)
+ifeq ($(strip $(DODMALLOC)),true)
     # For testing mem leaks with dmalloc
     CFLAGS+=-DDMALLOC
     LIBRARIES = -ldmalloc
     # Force debug=true, since this is useless when not debugging...
     DODEBUG = true
 endif
-ifeq ($(DODEBUG),true)
+ifeq ($(strip $(DODEBUG)),true)
     CFLAGS  += $(WARNINGS) -g -D_GNU_SOURCE
     LDFLAGS += -Wl,-warn-common
     STRIP    =
@@ -127,7 +121,7 @@ else
     LDFLAGS += -s -Wl,-warn-common
     STRIP    = $(STRIPTOOL) --remove-section=.note --remove-section=.comment $(PROG)
 endif
-ifeq ($(DOSTATIC),true)
+ifeq ($(strip $(DOSTATIC)),true)
     LDFLAGS += --static
     #
     #use '-ffunction-sections -fdata-sections' and '--gc-sections' (if they 
@@ -153,23 +147,24 @@ endif
 #
 # Work in progress by <ldoolitt@recycle.lbl.gov>.
 # If it gets in your way, set DISABLE_VPATH=yes
-ifeq ($(DISABLE_VPATH),yes)
+ifeq ($(strip $(DISABLE_VPATH)),yes)
     CONFIG_H = Config.h
 else
     VPATH = .:$(BB_SRC_DIR)
     CONFIG_LIST = $(addsuffix /Config.h,$(subst :, ,$(VPATH)))
     CONFIG_H    = $(word 1,$(shell ls -f -1 $(CONFIG_LIST) 2>/dev/null))
-    CFLAGS += -I- $(patsubst %,-I%,$(subst :, ,$(VPATH))) $(CROSS_CFLAGS)
+    CFLAGS += -I- $(patsubst %,-I%,$(subst :, ,$(VPATH)))
 endif
 
 OBJECTS   = $(shell $(BB_SRC_DIR)/busybox.sh $(CONFIG_H) $(BB_SRC_DIR)) busybox.o messages.o usage.o utility.o
+CFLAGS    += $(CROSS_CFLAGS)
 CFLAGS    += -DBB_VER='"$(VERSION)"'
 CFLAGS    += -DBB_BT='"$(BUILDTIME)"'
 ifdef BB_INIT_SCRIPT
     CFLAGS += -DINIT_SCRIPT='"$(BB_INIT_SCRIPT)"'
 endif
 
-ifneq ($(USE_SYSTEM_PWD_GRP),true)
+ifneq ($(strip $(USE_SYSTEM_PWD_GRP)),true)
     PWD_LIB   = pwd_grp/libpwd.a
     LIBRARIES += $(PWD_LIB)
 else
@@ -253,7 +248,8 @@ busybox.links: Config.h applets.h
 
 nfsmount.o cmdedit.o: %.o: %.h
 $(OBJECTS): %.o: %.c Config.h busybox.h applets.h Makefile
-       $(CC) $(CFLAGS) -c $*.c -o $*.o
+
+usage.o: usage.h
 
 utility.o: loop.h
 
@@ -270,7 +266,7 @@ clean:
            docs/busybox.lineo.com/BusyBox.html
        - rm -f docs/busybox.txt docs/busybox.dvi docs/busybox.ps \
            docs/busybox.pdf docs/busybox.lineo.com/busybox.html
-       - rm -f Config.h.ORG bb.def.h busybox.REGRESS.sh.results bb.OptionsAndFeatures
+       - rm -f multibuild.log Config.h.orig
        - rm -rf docs/busybox _install
        - rm -f busybox.links loop.h *~ *.o core