[processor-sdk/performance-audio-sr.git] / psdk_cust / pdk_k2g_1_0_1_1_eng / packages / ti / board / diag / makefile
1 # Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
2 #
3 #
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions
6 # are met:
7 #
8 # Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 #
11 # Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the
14 # distribution.
15 #
16 # Neither the name of Texas Instruments Incorporated nor the names of
17 # its contributors may be used to endorse or promote products derived
18 # from this software without specific prior written permission.
19 #
20 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 # ROOT Directory
33 ifndef PDK_INSTALL_PATH
34 export ROOTDIR := ../..
35 else
36 export ROOTDIR = $(PDK_INSTALL_PATH)
37 endif
39 # PDK Board Library
40 ifndef PDK_DIAG_DIR
41 export PDK_DIAG_DIR = $(ROOTDIR)/ti/board
42 endif
44 # Common Macros used in make
45 ifndef RM
46 export RM = rm -f
47 endif
49 ifndef CP
50 export CP = cp -p
51 endif
53 export MKDIR = mkdir -p
55 ifndef RMDIR
56 export RMDIR = rm -rf
57 endif
59 ifndef SED
60 export SED = sed
61 endif
63 ifndef MAKE
64 export MAKE = make
65 endif
67 ifeq ($(OS),Windows_NT)
68 export SDSCRIPT=create_sd.bat
69 else
70 export SDSCRIPT=./create_sd.sh
71 endif
73 ALL_BOARDS = idkAM571x idkAM572x evmAM572x evmK2G evmAM335x evmAM437x
75 idkAM571x_DIAG = dcan eeprom emmc framework framework_loader gmac haptics icss_emac lcd_touchscreen led led_industrial mcspi mem mmcsd pmic qspi uart
76 idkAM572x_DIAG = dcan eeprom emmc framework framework_loader gmac haptics icss_emac lcd_touchscreen led led_industrial mcspi mem mmcsd pmic qspi uart
77 evmAM571x_DIAG = eeprom framework framework_loader led mem pmic temperature uart
78 evmAM572x_DIAG = eeprom emmc framework framework_loader gmac led mem mmcsd pmic temperature uart
79 evmK2G_DIAG = dcan eeprom emmc framework hdmi lcd led mem nand norflash qspi temperature uart uart2usb
80 evmAM437x_DIAG = buzzer framework framework_loader haptics led mem uart
81 evmAM335x_DIAG = framework framework_loader mem uart
83 BUILD_DIRS = $(foreach a,$($(btests)),$(a)_build)
84 CLEAN_TARGETS = $(foreach a,$(ALL_BOARDS),$(a)_clean)
85 CLEAN_DIRS = $(foreach a,$($(ctests)),$(a)_clean)
86 ALL_SD = $(foreach a,$(ALL_BOARDS),$(a)_sd)
88 .PHONY: $(ALL_BOARDS) $(BUILD_DIRS) $(CLEAN_TARGETS) $(CLEAN_DIRS) $(ALL_SD)
90 all: $(ALL_BOARDS)
92 $(ALL_BOARDS):
93 $(MAKE) buildtarget bboard=$@ btests=$@_DIAG
95 buildtarget: $(BUILD_DIRS)
97 $(BUILD_DIRS):
98 $(MAKE) -C $(subst _build,,$@) BOARD=$(bboard) TARGET=armv7
100 $(ALL_SD):
101 $(MAKE) sdtarget sboard=$(subst _sd,,$@)
103 sdtarget: $(sboard)
104 $(SDSCRIPT) $(sboard)
106 clean: $(CLEAN_TARGETS)
108 $(CLEAN_TARGETS):
109 $(MAKE) cleantarget cboard=$(subst _clean,,$@) ctests=$(subst _clean,_DIAG,$@)
111 cleantarget: $(CLEAN_DIRS)
113 $(CLEAN_DIRS):
114 -$(MAKE) -C $(subst _clean,,$@) BOARD=$(cboard) TARGET=armv7 clean