]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - cpu/i386/Makefile
Add support for a saving build objects in a separate directory.
[people/ms/u-boot.git] / cpu / i386 / Makefile
index c44412a025b7884bba2561b9f2cee986eb0f4e11..cd46dea2c7401fdb0bef839117f86cc086b50631 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+# 
 # (C) Copyright 2002
 # Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
 #
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o start16.o reset.o
 COBJS  = serial.o interrupts.o cpu.o timer.o sc520.o
-AOBJS  = sc520_asm.o
+SOBJS  = sc520_asm.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
 
-$(LIB):        $(COBJS) $(AOBJS)
-       $(AR) crv $@ $(COBJS) $(AOBJS)
+all:   $(obj).depend $(START) $(LIB)
+
+$(LIB):        $(OBJS)
+       $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(COBJS:.o=.c) $(AOBJS:.o=.S)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(COBJS:.o=.c) $(AOBJS:.o=.S) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################