1 #**************************************************************************
2 #* FILE PURPOSE: 2nd stage makefile for the i2c parameter writer
3 #**************************************************************************
4 #* FILE NAME: makestg2
5 #*
6 #* DESCRIPTION: Builds the i2c parameter writer for a specific target
7 #*
8 #**************************************************************************
10 DEVICES= c6455 c6472 c6474 c6474l c6457
12 ifndef IBL_ROOT
13 IBL_ROOT=../..
14 endif
16 ifeq ($(ENDIAN),big)
17 IEXT=be
18 else
19 IEXT=le
20 endif
22 ECODIR= $(IBL_ROOT)/util/i2cConfig
24 MODULES= hw
25 CLEAN_MODULES=$(addprefix clean_,$(MODULES))
28 CSRC= i2cparam.c
31 # enable debug info in the compile
32 UTIL=yes
34 include $(IBL_ROOT)/make/$(ARCH)/makeeco.mk
36 C6X_C_DIR= $(IBL_ROOT)
37 C6X_C_DIR+=;$(IBL_ROOT)/hw/i2c
38 C6X_C_DIR+=;$(IBL_ROOT)/hw/plls
39 C6X_C_DIR+=;$(STDINC)
40 C6X_C_DIR+=;$(IBL_ROOT)/cfg/$(TARGET)
41 C6X_C_DIR+=;$(IBL_ROOT)/device/$(TARGET)
42 C6X_C_DIR+=;$(IBL_ROOT)/arch/$(ARCH)
43 export C6X_C_DIR
46 export ARCH
47 export TARGET
49 .PHONY: i2cparam.cmd
51 $(DEVICES): gen_cdefdep $(MODULES) $(OBJS) i2cparam.cmd
52 $(LD) -o i2cparam_$(TARGET)_$(IEXT).out -m i2cparam_$(TARGET)_$(IEXT).map i2cparam.$(IEXT).oc ../../hw/c64x/make/i2c.$(IEXT).oc ../../hw/c64x/make/pll.$(IEXT).oc i2cparam.cmd $(RTLIBS)
54 $(MODULES):
55 @echo making $@
56 make -C $(IBL_ROOT)/$@/$(ARCH)/make $@
59 clean2: $(CLEAN_MODULES)
60 @rm -f $(OBJS)
61 @rm -f $(subst .c,.dc,$(CSRC))
64 $(CLEAN_MODULES):
65 @echo cleaning $(subst clean_, ,$@)
66 make -C $(IBL_ROOT)/$(subst clean_,,$@)/$(ARCH)/make clean
69 $(OBJS): cdefdep
72 gen_cdefdep:
73 @echo Checking command line dependencies
74 @echo $(TARGET) $(ARCH) > cdefdep.tmp
75 @sh -c 'if diff -q cdefdep.tmp cdefdep ; then echo same ; else $(CP) cdefdep.tmp cdefdep ; fi '