Bug fix for automatic file format detection
[keystone-rtos/ibl.git] / src / make / Makefile
1 #*******************************************************************************************
2 #* FILE PURPOSE: Top level make for the IBL
3 #*******************************************************************************************
4 #* FILE NAME: Makefile
5 #*
6 #* DESCRIPTION: Builds the Intermediate Boot Loader (IBL)
7 #*
8 #*  Usage:  make c6455 | c6472 | c6474 | c6457 [DEBUG=yes] [ETH=no] [NAND=no]  \
9 #*          [BIS=no] [COFF=no] [BLOB=no] [ELF=no] [ENDIAN= both | big | little] [I2C_BUS_ADDR= 0x50 | 0x51] \
10 #*                      [COMPACT_I2C=yes]
11 #*
12 #* or to make a board specific configuraiton
13 #*
14 #*                      make evm_c6455 | evm_c6472 | evm_c6474
15 #*
16 #* or to test the builds by making all the devices and testing excludes
17 #*
18 #*                      make test_build
19 #*******************************************************************************************
21 IBLS_C6X= c6455 c6472 c6474 c6474l c6457
22 EVMS_C6X= evm_c6455 evm_c6472 evm_c6474
25 # Excluding functions from the build reduces the I2C eeprom memory used and
26 # speeds the initial boot time. Note that boot table cannot be excluded
27 # because it is required for the two stage I2C load process
29 EXCLUDES=
31 ifeq ($(ETH),no)
32  EXCLUDES+= ETH
33 endif
35 ifeq ($(NAND),no)
36  EXCLUDES+= NAND
37 endif
39 ifeq ($(BIS),no)
40  EXCLUDES+= BIS
41 endif
43 ifeq ($(COFF),no)
44  EXCLUDES+= COFF
45 endif
47 ifeq ($(BLOB),no)
48  EXCLUDES+= BLOB
49 endif
51 ifeq ($(ELF),no)
52  EXCLUDES+= ELF
53 endif
54  
59 # The endian of the build. The default target builds a single ROM image with both endians present
60 ifeq ($(ENDIAN),big)
61  ENDIAN_MODE=big
62 else
63  ifeq ($(ENDIAN),little)
64   ENDIAN_MODE=little
65  else
66   ENDIAN_MODE=both
67  endif
68 endif
70 # The i2c ROM bus address. The code will advance accross I2C bus address boundaries (the code must
71 # be blocked so that a single block doesn't cross a boundary, however). 
72 ifndef I2C_BUS_ADDR
73  I2C_BUS_ADDR=0x50
74 endif
78 all:
79         @echo must specify a target [ $(IBLS_C6X) $(EVMS_C6X) ]
82 # The debug flag changes compiler options
83 ifndef DEBUG
84  DEBUG=no
85 endif
86 export DEBUG
89 $(IBLS_C6X): 
90         make -f makestg1 ARCH=c64x TARGET=$@ I2C_BUS_ADDR=$(I2C_BUS_ADDR) COMPACT_I2C=$(COMPACT_I2C) ENDIAN_MODE=$(ENDIAN_MODE) EXCLUDES='$(EXCLUDES)' $@
93 # Configurations for individual evms
94 # The c455 EVM has a 128k eeprom (64k at 0x50, 64k at 0x51), so both endians are built with full functionality
95 evm_c6455:
96         make -f makestg1 ARCH=c64x TARGET=c6455 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES= c6455
98 # The c6472 EVM has a 128k eeprom (64k at 0x50, 64k at 0x51), so both endians are built with full functionality
99 evm_c6472:
100         make -f makestg1 ARCH=c64x TARGET=c6472 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES= c6472
102 # The 6474 EVM has a 32k eeprom. A stripped down version is build with only one endian.
103 evm_c6474:
104         make -f makestg1 ARCH=c64x TARGET=c6472 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=little EXCLUDES='ELF NAND BIS' c6474
105         cp ibl_c6474/i2crom.dat ibl_c6474/i2crom.dat i2crom_0x50.dat
106         make -f makestg1 ARCH=c64x TARGET=c6472 I2C_BUS_ADDR=0x51 COMPACT_I2C=no ENDIAN_MODE=big EXCLUDES='ELF NAND BIS' c6474
107         cp ibl_c6474/i2crom.dat ibl_c6474/i2crom.dat i2crom_0x51.dat
110 # Test - builds all the targets, with single component exclusion
111 test_build:
112         make -f makestg1 ARCH=c64x TARGET=c6455 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=     c6455
113         make -f makestg1 ARCH=c64x TARGET=c6455 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=ETH  c6455
114         make -f makestg1 ARCH=c64x TARGET=c6455 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=NAND c6455
115         make -f makestg1 ARCH=c64x TARGET=c6455 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=BIS  c6455
116         make -f makestg1 ARCH=c64x TARGET=c6455 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=COFF c6455
117         make -f makestg1 ARCH=c64x TARGET=c6455 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=ELF  c6455
118         make -f makestg1 ARCH=c64x TARGET=c6455 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=BLOB c6455
120         make -f makestg1 ARCH=c64x TARGET=c6472 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=     c6455
121         make -f makestg1 ARCH=c64x TARGET=c6472 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=ETH  c6455
122         make -f makestg1 ARCH=c64x TARGET=c6472 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=NAND c6455
123         make -f makestg1 ARCH=c64x TARGET=c6472 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=BIS  c6455
124         make -f makestg1 ARCH=c64x TARGET=c6472 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=COFF c6455
125         make -f makestg1 ARCH=c64x TARGET=c6472 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=ELF  c6455
126         make -f makestg1 ARCH=c64x TARGET=c6472 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=BLOB c6455
128         make -f makestg1 ARCH=c64x TARGET=c6474 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=     c6455
129         make -f makestg1 ARCH=c64x TARGET=c6474 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=ETH  c6455
130         make -f makestg1 ARCH=c64x TARGET=c6474 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=NAND c6455
131         make -f makestg1 ARCH=c64x TARGET=c6474 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=BIS  c6455
132         make -f makestg1 ARCH=c64x TARGET=c6474 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=COFF c6455
133         make -f makestg1 ARCH=c64x TARGET=c6474 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=ELF  c6455
134         make -f makestg1 ARCH=c64x TARGET=c6474 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=BLOB c6455
136 # will need to add a line for each additional ARCH type added
137 clean:
138         make -f makestg2 clean   ARCH=c64x
139         make -f makestg2 cleant  ARCH=c64x TARGET=c6472
140         make -f makestg2 cleant  ARCH=c64x TARGET=c6474
141         make -f makestg2 cleant  ARCH=c64x TARGET=c6474l
142         make -f makestg2 cleant  ARCH=c64x TARGET=c6457
143         make -C ../util/bconvert       clean
144         make -C ../util/btoccs         clean
145         make -C ../util/i2cConfig      clean
146         make -C ../util/nandWriter     clean
147         make -C ../util/romparse       clean
148         make -C ../test/test1              clean
149         make -C ../test/test2              clean