summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Loeliger <jdl@freescale.com>2006-09-19 09:34:10 -0500
committerJon Loeliger <jdl@freescale.com>2006-09-19 09:34:10 -0500
commitafbdc649f8751e4f4f1a6f527edfe139773f2c15 (patch)
treed9191d029193731b7af663bb61f5ca447d359b2f
parentafa98843e4665add11b69496341053b268156e3a (diff)
downloadu-boot-imx-afbdc649f8751e4f4f1a6f527edfe139773f2c15.zip
u-boot-imx-afbdc649f8751e4f4f1a6f527edfe139773f2c15.tar.gz
u-boot-imx-afbdc649f8751e4f4f1a6f527edfe139773f2c15.tar.bz2
Modified makefile for new build mechanism.
Signed-off-by: Jon Loeliger <jdl@freescale.com>
-rw-r--r--board/mpc8641hpcn/Makefile19
-rw-r--r--cpu/mpc86xx/Makefile17
2 files changed, 21 insertions, 15 deletions
diff --git a/board/mpc8641hpcn/Makefile b/board/mpc8641hpcn/Makefile
index f70f44b..46214ed 100644
--- a/board/mpc8641hpcn/Makefile
+++ b/board/mpc8641hpcn/Makefile
@@ -23,12 +23,16 @@
include $(TOPDIR)/config.mk
-LIB = lib$(BOARD).a
+LIB = $(obj)lib$(BOARD).a
-OBJS := $(BOARD).o pixis.o sys_eeprom.o
+COBJS := $(BOARD).o pixis.o sys_eeprom.o
SOBJS := init.o
-$(LIB): $(OBJS) $(SOBJS)
+SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS := $(addprefix $(obj),$(COBJS))
+SOBJS := $(addprefix $(obj),$(SOBJS))
+
+$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(AR) crv $@ $(OBJS)
clean:
@@ -40,10 +44,9 @@ distclean: clean
#########################################################################
-.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
- $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
-ifeq ($(filter distclean, $(MAKECMDGOALS)),)
--include .depend
-endif
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude ($obj).depend
#########################################################################
diff --git a/cpu/mpc86xx/Makefile b/cpu/mpc86xx/Makefile
index 7995945..ad5b36d 100644
--- a/cpu/mpc86xx/Makefile
+++ b/cpu/mpc86xx/Makefile
@@ -25,24 +25,27 @@
include $(TOPDIR)/config.mk
-LIB = lib$(CPU).a
+LIB = $(obj)lib$(CPU).a
START = start.o #resetvec.o
-ASOBJS = cache.o
+SOBJS = cache.o
COBJS = traps.o cpu.o cpu_init.o speed.o interrupts.o \
pci.o pcie_indirect.o i2c.o spd_sdram.o
-OBJS = $(COBJS)
-all: .depend $(START) $(ASOBJS) $(LIB)
+SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START := $(addprefix $(obj),$(START))
+
+all: $(obj).depend $(START) $(LIB)
$(LIB): $(OBJS)
$(AR) crv $@ $(ASOBJS) $(OBJS)
#########################################################################
-.depend: Makefile $(START:.o=.S) $(ASOBJS:.o=.S) $(COBJS:.o=.c)
- $(CC) -M $(CFLAGS) $(START:.o=.S) $(ASOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
-sinclude .depend
+sinclude $(obj).depend
#########################################################################