NOTICE OF RELOCATION
[keystone-rtos/sbl.git] / makefile
1 #*******************************************************************************
2 #* FILE PURPOSE: Top level makefile for Creating Component Libraries for ARM
3 #* architectures
4 #*******************************************************************************
5 #* FILE NAME: makefile
6 #*
7 #* DESCRIPTION: Defines Compiler tools paths, libraries , Build Options 
8 #*
9 #*
10 #*******************************************************************************
11 #*
12 # (Mandatory) Specify where various tools are installed.
14 ifeq ($(RULES_MAKE), )
15 include $(PDK_INSTALL_PATH)/ti/build/Rules.make
16 else
17 include $(RULES_MAKE)
18 endif
20 #Default Do not use the shared object libraries for the test/example applications
21 export USEDYNAMIC_LIB ?= "no"
23 #export SOC ?= AM572x
24 export SOC
25 export BOOTMODE
26 export OPPMODE
27 export SECUREMODE
29 export LLD_NAME=sbl
31 # ROOT Directory
32 export ROOTDIR := ../..
34 #Check to identify between windows or linux environment
35 ifeq ($(OS), )
36   OS := linux
37 endif
39 # INCLUDE Directory
40 export INCDIR := ../..;$(PDK_INSTALL_PATH);$(ROOTDIR);$(SBL_INC_DIR)
42 # Common Macros used in make
44 ifndef RM
45 export RM = rm -f
46 endif
48 ifndef CP
49 export CP = cp -p
50 endif
52 export MKDIR = mkdir -p
54 ifndef RMDIR
55 export RMDIR = rm -rf
56 endif
58 ifndef SED
59 export SED = sed
60 endif
62 ifndef MAKE
63 export MAKE = make
64 endif
66 # PHONY Targets
67 .PHONY: all clean spi_flashwriter spi_flashwriter_clean flashwriter flashwriter_clean mmcsd_flashwriter mmcsd_flashwriter_clean example example_clean tools sbl_lib sbl_lib_clean
69 # all rule
70 all:
71         @$(MAKE) -f ./board/$(BOARD)/build/makefile all
73 spi_flashwriter:
74         @$(MAKE) -f ./tools/flashWriter/spi/src/makefile $@
76 flashwriter:
77         @$(MAKE) -f ./tools/flashWriter/qspi/src/makefile $@
79 mmcsd_flashwriter:
80         @$(MAKE) -f ./tools/flashWriter/mmcsd/src/makefile $@
82 example:
83         @$(MAKE) -f ./example/mpuMulticoreApp/makefile $@
84         @$(MAKE) -f ./example/dsp1MulticoreApp/makefile $@
85         @$(MAKE) -f ./example/ipu1MulticoreApp/makefile $@
86 ifeq ($(SOC),$(filter $(SOC), AM572x AM574x))
87         @$(MAKE) -f ./example/mpu1MulticoreApp/makefile $@
88         @$(MAKE) -f ./example/dsp2MulticoreApp/makefile $@
89         @$(MAKE) -f ./example/ipu2MulticoreApp/makefile $@
90 endif
92 eveLoader:
93 ifeq ($(SOC),$(filter $(SOC), AM572x AM574x))
94         @$(MAKE) -C  ./example/mpuM4EveLoaderApp $@
95 endif
97 tools:
98         @$(MAKE) -C tools/btoccs
99         @$(MAKE) -C tools/byteswap
100         @$(MAKE) -C tools/ccsutil
101         @$(MAKE) -C tools/tiImageGen
103 sbl_lib:
104         @$(MAKE) -f ./src/sbl_eve/sbl_lib/src/makefile $@
107 # Rule to clean sbl binary
108 clean:
109         @$(MAKE) -f ./board/$(BOARD)/build/makefile $@
110         @$(RMDIR) $(PDK_INSTALL_PATH)/ti/boot/$(LLD_NAME)/binary/$(BOARD)
112 spi_flashwriter_clean:
113         @$(MAKE) -f ./tools/flashWriter/spi/src/makefile $@
115 flashwriter_clean:
116         @$(MAKE) -f ./tools/flashWriter/qspi/src/makefile $@
117         @$(RMDIR) $(PDK_INSTALL_PATH)/ti/boot/sbl/tools/flashWriter/qspi/bin/$(BOARD)
119 mmcsd_flashwriter_clean:
120         @$(MAKE) -f ./tools/flashWriter/mmcsd/src/makefile $@
122 example_clean:
123         @$(MAKE) -f ./example/mpuMulticoreApp/makefile $@
124         @$(MAKE) -f ./example/dsp1MulticoreApp/makefile $@
125         @$(MAKE) -f ./example/ipu1MulticoreApp/makefile $@
126 ifeq ($(SOC),$(filter $(SOC), AM572x AM574x))
127         @$(MAKE) -f ./example/dsp2MulticoreApp/makefile $@
128         @$(MAKE) -f ./example/ipu2MulticoreApp/makefile $@
129 endif
130         @$(RMDIR) $(PDK_INSTALL_PATH)/ti/boot/sbl/binary/sbl_multicore_app/$(BOARD)
132 sbl_lib_clean:
133         @$(MAKE) -f ./src/sbl_eve/sbl_lib/src/makefile $@
135 eveLoader_clean:
136 ifeq ($(SOC),$(filter $(SOC), AM572x AM574x))
137         @$(MAKE) -C ./example/mpuM4EveLoaderApp $@
138 endif