Bug fix for automatic file format detection
[keystone-rtos/ibl.git] / src / make / makestg1
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 | c6474l | 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 #*******************************************************************************************
13 IBLS_C6X= c6455 c6472 c6474 c6474l c6457
15 # Excluding functions from the build reduces the I2C eeprom memory used and
16 # speeds the initial boot time. Note that boot table cannot be excluded
17 # because it is required for the two stage I2C load process
19 # The endian of the build. The default target builds a single ROM image with both endians present
20 ifeq ($(ENDIAN_MODE),big)
21  I2CROM=        big_endian
22  STAGE1_TARGET= be_target
23 else
24  ifeq ($(ENDIAN_MODE),little)
25   I2CROM=        little_endian
26   STAGE1_TARGET= le_target
27  else
28   I2CROM=        both
29   STAGE1_TARGET= be_target le_target compare
30  endif
31 endif
33 # The i2c ROM bus address. The code will advance accross I2C bus address boundaries (the code must
34 # be blocked so that a single block doesn't cross a boundary, however). 
35 ifndef I2C_BUS_ADDR
36  I2C_BUS_ADDR=0x50
37 endif
39 # Excludes identify which components are not part of the build
40 export EXCLUDES
42 all:
43         @echo must specify a target [ $(IBLS_C6X) ]
47 be_target:
48         make -f makestg2 ARCH=c64x TARGET=$(TARGET) ENDIAN=big       I2C_BUS_ADDR=$(I2C_BUS_ADDR) $(TARGET)
50 le_target:
51         make -f makestg2 ARCH=c64x TARGET=$(TARGET) ENDIAN=little    I2C_BUS_ADDR=$(I2C_BUS_ADDR) $(TARGET)
53 compare:
54         make -f makestg2 ARCH=c64x TARGET=$(TARGET) compare
57 $(IBLS_C6X): $(STAGE1_TARGET)
58         make -f makestg2 ARCH=c64x TARGET=$@ I2CROM=$(I2CROM) I2C_BUS_ADDR=$(I2C_BUS_ADDR) COMPACT_I2C=$(COMPACT_I2C) i2cRom