]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/pdk.git/blob - packages/makefile
[DSS APP][PDK-9214]DSS Display Examples is not working on eDP
[processor-sdk/pdk.git] / packages / makefile
1 #*******************************************************************************
2 #* FILE PURPOSE: Top level makefile for Creating Component Libraries and example
3 #*               binaries of PDK
4 #*******************************************************************************
5 #* FILE NAME: makefile
6 #*
7 #* DESCRIPTION: Builds the PDK Drivers & Examples
8 #*
9 #*
10 #*******************************************************************************
11 #*
12 # (Mandatory) Specify where various tools are installed.
13 .NOTPARALLEL:
14 # This make file is not parallel in its highest level. This is done to serialize the multiple SOCS,BOARDS,CORES.
15 # However the subsequent makefiles invoked by this makefile have parallelism supported. i.e -j option given to this
16 # makefile will be passed on to the subsequent makefiles resulting in parallel builds.
18 #Default when PDK env script is not run
19 PDK_INSTALL_PATH ?= $(abspath .)
20 SDK_INSTALL_PATH ?= $(abspath ../../)
22 ifeq ($(RULES_MAKE), )
23 include $(PDK_INSTALL_PATH)/ti/build/Rules.make
24 else
25 include $(RULES_MAKE)
26 endif
28 ifndef MAKE
29 export MAKE = make
30 endif
32 ifndef ECHO
33 export ECHO = echo
34 endif
36 ifndef RM
37 export RM = rm -f
38 endif
40 ifndef CP
41 export CP = cp
42 endif
44 ifneq ($(LIMIT_SOCS),)
45 SOC_LIST = $(LIMIT_SOCS)
46 else
47 SOC_LIST = $(SOC)
48 endif
50 ifneq ($(LIMIT_BOARDS),)
51 BOARD_LIST = $(LIMIT_BOARDS)
52 else
53 BOARD_LIST = $(BOARD)
54 endif
57 ifneq ($(LIMIT_CORES),)
58 # PRU cores are not built directly
59 CORE_LIST = $(filter-out $(PRUCORE_LIST),$(LIMIT_CORES))
60 else
61 CORE_LIST = $(CORE)
62 endif
64 .PHONY: all all_libs all_examples clean env_check help xdc_meta \
65    buildinfra_all buildinfra_clean buildinfra_pdk_examples \
66    non-buildinfra_all non-buildinfra_clean buildinfra_pdk_libs  non-buildinfra_pdk_examples \
67    cplusplus_build
69 # Default BUILD profile is release
70 BUILD_PROFILE ?= release
71 #The top level makefile two kinds of sub modules. Ones which are supported by the 'build infrastructure' and which are not.
72 # i.e The modules which supports 'build infrastructure' are included in ti/build/component.mk and follow a standard set of conventions and targets.
73 # They can be built using ti/build/makefile. Many newer targets such as AM3/4/5/6/7 have their modules in this category.
74 # Those targets in this makefile has the 'buildinfra_' prefix in them.
76 # The non-build infrastructure modules are the ones which do not adhere to the ti/build/component.mk . They have custom makefiles which are either RTSC generated or custom written makefiles with custom targets & build options.
77 # Many legacy components for K1/K2 follow this methodology.
78 # Those non-build infrastructure targets in this makefile has 'non-buildinfra_' prefix in them.
81 ### Common targets for build infra and non-build infra
82 all: env_check buildinfra_all non-buildinfra_all
83 all_libs: env_check buildinfra_pdk_libs non-buildinfra_pdk_libs
84 all_examples: env_check buildinfra_pdk_examples non-buildinfra_pdk_examples
85 clean: env_check buildinfra_clean non-buildinfra_clean
87 ### Targets which are built by build infrastructure (ti/build/makefile
88 # The below builds for each SOC, its applicable BOARDS and CORES, filtered by the LIMIT_SOCS/BOARDS/CORES
90 buildinfra_all buildinfra_pdk_libs buildinfra_pdk_examples buildinfra_clean :
91         $(foreach current_soc, $(SOC_LIST),\
92         $(foreach current_board, $(filter $(BOARD_LIST),$(BOARD_LIST_$(current_soc)) ), \
93         $(foreach current_core, $(filter $(CORE_LIST),$(CORE_LIST_$(current_soc)) ), \
94         $(MAKE) -C $(PDK_INSTALL_PATH)/ti/build -f makefile $(subst buildinfra_,,$@) CORE=$(current_core) BOARD=$(current_board) SOC=$(current_soc) BUILD_PROFILE=$(BUILD_PROFILE);\
95         )))
97 #       echo "$@ called with CORE=$(current_core) BOARD=$(current_board) SOC=$(current_soc) BUILD_PROFILE=$(BUILD_PROFILE)";\
99 ### Targets which are not built by build infrastructure, (eg legacy rtsc generated makefiles,custom makefiles
100 non-buildinfra_all non-buildinfra_pdk_libs non-buildinfra_pdk_examples:
101         $(MAKE) -C $(PDK_INSTALL_PATH)/ti/build -f makefile_non-buildinfra $(subst non-buildinfra_,,$@) PDK_SOC=$(PDK_SOC)
103 ### Non library/example targets
105 env_check:
106 ifneq ($(PDK_SOC),$(filter $(PDK_SOC), $(PROCSDK_SUPPORTED_PDK_SOCS)))
107         $(ECHO) "Warning !! PDK_SOC is not set properly!!!"
108         $(ECHO) "PDK_SOC should be set to any of the values: $(PROCSDK_SUPPORTED_PDK_SOCS)"
109 endif
111 help: env_check
112         $(ECHO) "------------------------------------------------------"
113         $(ECHO) "\# Top level make help"
114         $(ECHO) "------------------------------------------------------"
115         $(ECHO) "make <target> [OPTIONAL ARGUMENTS]"
116         $(ECHO) ""
117         $(ECHO) "------------------"
118         $(ECHO) "TARGETS <target>"
119         $(ECHO) "------------------"
120         $(ECHO) " all: Builds all modules (includes library & applications). Available modules are "
121         $(ECHO) "     Example:  \"make all \""
122         $(ECHO) ""
123         $(ECHO) " clean: Cleans libraries & applications of all modules. Available modules are "
124         $(ECHO) "     Example:  \"make clean \""
125         $(ECHO) ""
126         $(ECHO) " all_libs: Builds all pdk driver libraries"
127         $(ECHO) "     Example:  \"make all_libs \""
128         $(ECHO) ""
129         $(ECHO) " clean: Cleans libraries & applications of all modules."
130         $(ECHO) "     Example:  \"make clean \""
131         $(ECHO) ""
132         $(ECHO) " xdc_meta/xdc_meta: Generates xdc meta file (used if pdk is cloned from pdk.git)."
133         $(ECHO) "     Example:  \"make xdc_meta \""
134         $(ECHO) ""
135         $(ECHO) "------------------"
136         $(ECHO) "OPTIONAL ARGUMENTS "
137         $(ECHO) "------------------"
138         $(ECHO) "LIMIT_SOCS=<socs>  This will restrict the building of libraries/apps to the particular SOC(s) specified"
139         $(ECHO) "Valid values of LIMIT_SOCS are $(LIMIT_SOCS)"
140         $(ECHO) ""
141         $(ECHO) "LIMIT_BOARDS=<boards>  This will restrict the building of libraries/apps to the particular BOARD(s) specified"
142         $(ECHO) "Valid values of LIMIT_BOARDS are $(LIMIT_BOARDS)"
143         $(ECHO) ""
144         $(ECHO) "LIMIT_CORES=<cores>  This will restrict the building of libraries/apps to the particular CORE(s) specified"
145         $(ECHO) "Valid values of LIMIT_CORES are $(LIMIT_CORES)"
146         $(ECHO) ""
147         $(ECHO) "PDK_SOC=<soc>  This will specify the SOC version if the pdk directory does not specify it (if git clone pdk.git is used)"
148         $(ECHO) "If pdk is git cloned, PDK_SOC should be set to the <soc> where the original PDK directory from the installer was pdk_<soc>_<version>)"
149         $(ECHO) "For example if the original PDK installed directory (which got replaced by pdk.git) was <procsdk_install_dir>/pdk_am65xx_1_0_5, PDK_SOC=am65xx"
150         $(ECHO) " PDK_SOC should be set to any of the values: $(PROCSDK_SUPPORTED_PDK_SOCS)"
151         $(ECHO) ""
152         $(ECHO) "BUILD_PROFILE=<release/debug>  This will determine the type of libraries/examples generated (release/debug friendly). Default is 'release "
153         $(ECHO) "Valid values of LIMIT_CORES are $(LIMIT_CORES)"
154         $(ECHO) ""
155         $(ECHO) "SOC=<soc> CORE=<core> BOARD=<board> This will build libraries/examples for the specified combination of <soc,core,board>"
156         $(ECHO) "Valid values of SOC/BOARD/CORE are found from LIMIT_SOC/BOARD/CORES above"
161 # if PDK.git is initiated from a fresh clone, the XDC meta headers will not have been generated. (xdc meta headers are used for CCS based projects)
162 # These headers are usually generated during the procsdk installer building process ('make release' from within a component's directory)
163 # This xdc_meta target will help enable the user to generate the same meta files after a fresh git clone of pdk
165 # Find all the directories with package.xdc and run xdc_meta on them to generate the rtsc meta files
166 PACKAGE_XDC_LOC := $(wildcard */package.xdc)
167 PACKAGE_XDC_LOC += $(wildcard */*/package.xdc)
168 PACKAGE_XDC_LOC += $(wildcard */*/*/package.xdc)
169 PACKAGE_XDC_LOC += $(wildcard */*/*/*/package.xdc)
170 SUBDIRS =  $(filter-out ./,$(dir $(PACKAGE_XDC_LOC)))
171 xdc_meta:
172         $(foreach xdcdir, $(SUBDIRS),\
173         $(MAKE) -C $(xdcdir) $@; \
174         )
176 cplusplus_build:
177         $(MAKE) all BUILD_PROFILE=debug CPLUSPLUS_BUILD=yes