summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorMarian Balakowicz <m8@semihalf.com>2006-09-01 19:49:50 +0200
committerMarian Balakowicz <m8@semihalf.com>2006-09-01 19:49:50 +0200
commitf93286397ed2a7084efb0362a43ee09f11702349 (patch)
tree11e0c11781ba0b867831eff47a4178a464cf00b3 /fs
parent24d3d3754634532ae262075484e7c1d00d447152 (diff)
downloadu-boot-imx-f93286397ed2a7084efb0362a43ee09f11702349.zip
u-boot-imx-f93286397ed2a7084efb0362a43ee09f11702349.tar.gz
u-boot-imx-f93286397ed2a7084efb0362a43ee09f11702349.tar.bz2
Add support for a saving build objects in a separate directory.
Modifications are based on the linux kernel approach and support two use cases: 1) Add O= to the make command line 'make O=/tmp/build all' 2) Set environement variable BUILD_DIR to point to the desired location 'export BUILD_DIR=/tmp/build' 'make' The second approach can also be used with a MAKEALL script 'export BUILD_DIR=/tmp/build' './MAKEALL' Command line 'O=' setting overrides BUILD_DIR environent variable. When none of the above methods is used the local build is performed and the object files are placed in the source directory.
Diffstat (limited to 'fs')
-rw-r--r--fs/Makefile4
-rw-r--r--fs/cramfs/Makefile16
-rw-r--r--fs/ext2/Makefile18
-rw-r--r--fs/fat/Makefile15
-rw-r--r--fs/fdos/Makefile17
-rw-r--r--fs/jffs2/Makefile16
-rw-r--r--fs/reiserfs/Makefile18
7 files changed, 60 insertions, 44 deletions
diff --git a/fs/Makefile b/fs/Makefile
index 79cbdea..273d90e 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -1,5 +1,5 @@
#
-# (C) Copyright 2000, 2001
+# (C) Copyright 2000-2006
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
# See file CREDITS for list of people who contributed to this
@@ -24,6 +24,6 @@
SUBDIRS := jffs2 cramfs fdos fat reiserfs ext2
-.depend all:
+$(obj).depend all:
@for dir in $(SUBDIRS) ; do \
$(MAKE) -C $$dir $@ ; done
diff --git a/fs/cramfs/Makefile b/fs/cramfs/Makefile
index 54a475e..1a6f4b7 100644
--- a/fs/cramfs/Makefile
+++ b/fs/cramfs/Makefile
@@ -1,5 +1,5 @@
#
-# (C) Copyright 2000, 2001
+# (C) Copyright 2000-2006
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
# See file CREDITS for list of people who contributed to this
@@ -23,25 +23,27 @@
include $(TOPDIR)/config.mk
-LIB = libcramfs.a
+LIB = $(obj)libcramfs.a
AOBJS =
COBJS = cramfs.o uncompress.o
-OBJS = $(AOBJS) $(COBJS)
+
+SRCS := $(AOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS := $(addprefix $(obj),$(AOBJS) $(COBJS))
#CPPFLAGS +=
all: $(LIB) $(AOBJS)
-$(LIB): .depend $(OBJS)
+$(LIB): $(obj).depend $(OBJS)
$(AR) crv $@ $(OBJS)
#########################################################################
-.depend: Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
- $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
-sinclude .depend
+sinclude $(obj).depend
#########################################################################
diff --git a/fs/ext2/Makefile b/fs/ext2/Makefile
index 3b19368..2e420d5 100644
--- a/fs/ext2/Makefile
+++ b/fs/ext2/Makefile
@@ -1,4 +1,7 @@
#
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
# (C) Copyright 2003
# Pavel Bartusek, Sysgo Real-Time Solutions AG, pba@sysgo.de
#
@@ -24,25 +27,26 @@
include $(TOPDIR)/config.mk
-LIB = libext2fs.a
+LIB = $(obj)libext2fs.a
AOBJS =
COBJS = ext2fs.o dev.o
-OBJS = $(AOBJS) $(COBJS)
+
+SRCS := $(AOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS := $(addprefix $(obj),$(AOBJS) $(COBJS))
#CPPFLAGS +=
all: $(LIB) $(AOBJS)
-$(LIB): .depend $(OBJS)
+$(LIB): $(obj).depend $(OBJS)
$(AR) crv $@ $(OBJS)
-
#########################################################################
-.depend: Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
- $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
-sinclude .depend
+sinclude $(obj).depend
#########################################################################
diff --git a/fs/fat/Makefile b/fs/fat/Makefile
index e462757..2fa428c 100644
--- a/fs/fat/Makefile
+++ b/fs/fat/Makefile
@@ -19,28 +19,27 @@
# MA 02111-1307 USA
#
-TOPDIR=../../
-
include $(TOPDIR)/config.mk
-LIB = libfat.a
+LIB = $(obj)libfat.a
AOBJS =
COBJS = fat.o file.o
-OBJS = $(AOBJS) $(COBJS)
+SRCS := $(AOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS := $(addprefix $(obj),$(AOBJS) $(COBJS))
all: $(LIB) $(AOBJS)
-$(LIB): .depend $(OBJS)
+$(LIB): $(obj).depend $(OBJS)
$(AR) crv $@ $(OBJS)
#########################################################################
-.depend: Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
- $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
-sinclude .depend
+sinclude $(obj).depend
#########################################################################
diff --git a/fs/fdos/Makefile b/fs/fdos/Makefile
index c25e744..e55ac8a 100644
--- a/fs/fdos/Makefile
+++ b/fs/fdos/Makefile
@@ -1,4 +1,7 @@
#
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
# (C) Copyright 2002
# Stäubli Faverges - <www.staubli.com>
# Pierre AUBERT p.aubert@staubli.com
@@ -25,25 +28,27 @@
include $(TOPDIR)/config.mk
-LIB = libfdos.a
+LIB = $(obj)libfdos.a
AOBJS =
COBJS = fat.o vfat.o dev.o fdos.o fs.o subdir.o
-OBJS = $(AOBJS) $(COBJS)
+
+SRCS := $(AOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS := $(addprefix $(obj),$(AOBJS) $(COBJS))
#CPPFLAGS +=
all: $(LIB) $(AOBJS)
-$(LIB): .depend $(OBJS)
+$(LIB): $(obj).depend $(OBJS)
$(AR) crv $@ $(OBJS)
#########################################################################
-.depend: Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
- $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
-sinclude .depend
+sinclude $(obj).depend
#########################################################################
diff --git a/fs/jffs2/Makefile b/fs/jffs2/Makefile
index f28b17a..82436bb 100644
--- a/fs/jffs2/Makefile
+++ b/fs/jffs2/Makefile
@@ -1,5 +1,5 @@
#
-# (C) Copyright 2000, 2001
+# (C) Copyright 2000-2006
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
# See file CREDITS for list of people who contributed to this
@@ -23,26 +23,28 @@
include $(TOPDIR)/config.mk
-LIB = libjffs2.a
+LIB = $(obj)libjffs2.a
AOBJS =
COBJS = jffs2_1pass.o compr_rtime.o compr_rubin.o compr_zlib.o mini_inflate.o
COBJS += compr_lzo.o compr_lzari.o
-OBJS = $(AOBJS) $(COBJS)
+
+SRCS := $(AOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS := $(addprefix $(obj),$(AOBJS) $(COBJS))
#CPPFLAGS +=
all: $(LIB) $(AOBJS)
-$(LIB): .depend $(OBJS)
+$(LIB): $(obj).depend $(OBJS)
$(AR) crv $@ $(OBJS)
#########################################################################
-.depend: Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
- $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
-sinclude .depend
+sinclude $(obj).depend
#########################################################################
diff --git a/fs/reiserfs/Makefile b/fs/reiserfs/Makefile
index 98a9a8d..45028cb 100644
--- a/fs/reiserfs/Makefile
+++ b/fs/reiserfs/Makefile
@@ -1,4 +1,7 @@
#
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
# (C) Copyright 2003
# Pavel Bartusek, Sysgo Real-Time Solutions AG, pba@sysgo.de
#
@@ -24,25 +27,26 @@
include $(TOPDIR)/config.mk
-LIB = libreiserfs.a
+LIB = $(obj)libreiserfs.a
AOBJS =
COBJS = reiserfs.o dev.o mode_string.o
-OBJS = $(AOBJS) $(COBJS)
+
+SRCS := $(AOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS := $(addprefix $(obj),$(AOBJS) $(COBJS))
#CPPFLAGS +=
all: $(LIB) $(AOBJS)
-$(LIB): .depend $(OBJS)
+$(LIB): $(obj).depend $(OBJS)
$(AR) crv $@ $(OBJS)
-
#########################################################################
-.depend: Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
- $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
-sinclude .depend
+sinclude $(obj).depend
#########################################################################