summaryrefslogtreecommitdiff
path: root/board/trab
diff options
context:
space:
mode:
Diffstat (limited to 'board/trab')
-rw-r--r--board/trab/Makefile36
-rw-r--r--board/trab/config.mk2
2 files changed, 23 insertions, 15 deletions
diff --git a/board/trab/Makefile b/board/trab/Makefile
index 159404b..2b918f6 100644
--- a/board/trab/Makefile
+++ b/board/trab/Makefile
@@ -1,5 +1,5 @@
#
-# (C) Copyright 2000-2002
+# (C) Copyright 2000-2006
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
# See file CREDITS for list of people who contributed to this
@@ -23,43 +23,51 @@
include $(TOPDIR)/config.mk
-LIB = lib$(BOARD).a
+LIB = $(obj)lib$(BOARD).a
-OBJS := trab.o flash.o vfd.o cmd_trab.o memory.o tsc2000.o auto_update.o
+COBJS := trab.o flash.o vfd.o cmd_trab.o memory.o tsc2000.o auto_update.o
SOBJS := lowlevel_init.o
+COBJS_FKT := trab_fkt.o rs485.o tsc2000.o
+
+SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) $(COBJS_FKT:.o=.c)
+OBJS := $(addprefix $(obj),$(COBJS))
+SOBJS := $(addprefix $(obj),$(SOBJS))
+
+OBJS_FKT := $(addprefix $(obj),$(COBJS_FKT))
+
gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
LOAD_ADDR = 0xc100000
#########################################################################
-all: $(LIB) trab_fkt.srec trab_fkt.bin
+all: $(LIB) $(obj)trab_fkt.srec $(obj)trab_fkt.bin
-$(LIB): $(OBJS) $(SOBJS)
+$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(AR) crv $@ $(OBJS) $(SOBJS)
-trab_fkt.srec: trab_fkt.o rs485.o tsc2000.o $(LIB)
- $(LD) -g -Ttext $(LOAD_ADDR) -o $(<:.o=) -e $(<:.o=) $^ $(LIB) \
- -L../../examples -lstubs \
- -L../../lib_generic -lgeneric \
+$(obj)trab_fkt.srec: $(OBJS_FKT) $(LIB)
+ $(LD) -g -Ttext $(LOAD_ADDR) -o $(<:.o=) -e trab_fkt $^ $(LIB) \
+ -L$(obj)../../examples -lstubs \
+ -L$(obj)../../lib_generic -lgeneric \
-L$(gcclibdir) -lgcc
$(OBJCOPY) -O srec $(<:.o=) $@
-trab_fkt.bin: trab_fkt.srec
+$(obj)trab_fkt.bin: $(obj)trab_fkt.srec
$(OBJCOPY) -I srec -O binary $< $@
clean:
- rm -f $(SOBJS) $(OBJS)
+ rm -f $(SOBJS) $(OBJS) $(OBJS_FKT)
distclean: clean
rm -f $(LIB) core *.bak .depend
#########################################################################
-.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
- $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
--include .depend
+sinclude $(obj).depend
#########################################################################
diff --git a/board/trab/config.mk b/board/trab/config.mk
index f2411d0..800cc28 100644
--- a/board/trab/config.mk
+++ b/board/trab/config.mk
@@ -19,7 +19,7 @@
# download areas is 0C80'0000
#
-sinclude $(TOPDIR)/board/$(BOARDDIR)/config.tmp
+sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
ifndef TEXT_BASE
TEXT_BASE = 0x0DF40000