Merge pull request #4 in PROCESSOR-SDK/big-data-ipc-examples from PRSDK-5811 to master
[processor-sdk/big-data-ipc-examples.git] / host_bios / simple_buffer_example / makefile
1 #
2 #  Copyright (c) 2017 Texas Instruments Incorporated - http://www.ti.com
3 #  All rights reserved.
4 #
5 #  Redistribution and use in source and binary forms, with or without
6 #  modification, are permitted provided that the following conditions
7 #  are met:
8 #
9 #  *  Redistributions of source code must retain the above copyright
10 #     notice, this list of conditions and the following disclaimer.
11 #
12 #  *  Redistributions in binary form must reproduce the above copyright
13 #     notice, this list of conditions and the following disclaimer in the
14 #     documentation and/or other materials provided with the 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 "AS IS"
21 #  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 #  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 #  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24 #  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 #  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 #  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27 #  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 #  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29 #  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 #  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #
33 #
34 #  ======== makefile ========
35 #
37 # edit PROCLIST list to control how many executables to build
39 ifeq ($(PLATFORM),DRA7XX)
40 PROCLIST = host dsp
41 #PROCLIST = host ipu 
42 PROC_HOST_NAME = "HOST"
43 PROC_DSP_NAME = "DSP1"
44 #PROC_IPU_NAME = "IPU1"
45 PROC_NAME_LIST = "\\\"$(PROC_HOST_NAME)\\\", \\\"$(PROC_DSP_NAME)\\\""
46 #PROC_NAME_LIST = "\\\"$(PROC_HOST_NAME)\\\", \\\"$(PROC_IPU_NAME)\\\""
47 DSP_PLATFORM = ti.platforms.evmDRA7XX:dsp
48 HOST_PLATFORM = ti.platforms.evmDRA7XX:host
49 IPU_PLATFORM = ti.platforms.evmDRA7XX:ipu
50 SERVER = "$(PROC_DSP_NAME)"
51 BOARD_NAME = "idkAM572x"
52 else ifeq ($(PLATFORM),AM574x)
53 PROCLIST = host dsp
54 #PROCLIST = host ipu
55 PROC_HOST_NAME = "HOST"
56 PROC_DSP_NAME = "DSP1"
57 #PROC_IPU_NAME = "IPU1"
58 PROC_NAME_LIST = "\\\"$(PROC_HOST_NAME)\\\", \\\"$(PROC_DSP_NAME)\\\""
59 #PROC_NAME_LIST = "\\\"$(PROC_HOST_NAME)\\\", \\\"$(PROC_IPU_NAME)\\\""
60 DSP_PLATFORM = ti.platforms.evmDRA7XX:dsp
61 HOST_PLATFORM = ti.platforms.evmDRA7XX:host
62 IPU_PLATFORM = ti.platforms.evmDRA7XX:ipu
63 SERVER = "$(PROC_DSP_NAME)"
64 BOARD_NAME = "idkAM574x"
65 else ifeq ($(PLATFORM),TCI6638)
66 PROCLIST = host dsp
67 PROC_HOST_NAME = "HOST"
68 PROC_DSP_NAME = "CORE0"
69 PROC_NAME_LIST = "\\\"$(PROC_HOST_NAME)\\\", \\\"$(PROC_DSP_NAME)\\\""
70 DSP_PLATFORM = ti.platforms.evmTCI6638K2K:dsp
71 # Currently no IPC support for evmTCI6638K2K:host 
72 #   Hence using evmTCI6636K2H which is equivalent
73 HOST_PLATFORM = ti.platforms.evmTCI6636K2H:host
74 SERVER = "$(PROC_DSP_NAME)"
75 BOARD_NAME = "evmK2K"
76 else ifeq ($(PLATFORM),TCI6636)
77 PROCLIST = host dsp
78 PROC_HOST_NAME = "HOST"
79 PROC_DSP_NAME = "CORE0"
80 PROC_NAME_LIST = "\\\"$(PROC_HOST_NAME)\\\", \\\"$(PROC_DSP_NAME)\\\""
81 DSP_PLATFORM = ti.platforms.evmTCI6636K2H:dsp
82 HOST_PLATFORM = ti.platforms.evmTCI6636K2H:host
83 SERVER = "$(PROC_DSP_NAME)"
84 BOARD_NAME = "evmK2H"
85 else ifeq ($(PLATFORM),66AK2G)
86 PROCLIST = host dsp
87 PROC_HOST_NAME = "HOST"
88 PROC_DSP_NAME = "CORE0"
89 PROC_NAME_LIST = "\\\"$(PROC_HOST_NAME)\\\", \\\"$(PROC_DSP_NAME)\\\""
90 DSP_PLATFORM = ti.platforms.evmTCI66AK2G02:dsp
91 HOST_PLATFORM = ti.platforms.evmTCI66AK2G02:host
92 BOARD_NAME = "evmK2G"
93 SERVER = "$(PROC_DSP_NAME)"
94 else ifeq ($(PLATFORM),66AK2E)
95 PROCLIST = host dsp
96 PROC_HOST_NAME = "HOST"
97 PROC_DSP_NAME = "CORE0"
98 PROC_NAME_LIST = "\\\"$(PROC_HOST_NAME)\\\", \\\"$(PROC_DSP_NAME)\\\""
99 DSP_PLATFORM = ti.platforms.evmC66AK2E:dsp
100 HOST_PLATFORM = ti.platforms.evmC66AK2E:host
101 BOARD_NAME = "evmK2E"
102 SERVER = "$(PROC_DSP_NAME)"
103 else ifeq ($(PLATFORM),TCI6630)
104 PROCLIST = host dsp
105 PROC_HOST_NAME = "HOST"
106 PROC_DSP_NAME = "CORE0"
107 PROC_NAME_LIST = "\\\"$(PROC_HOST_NAME)\\\", \\\"$(PROC_DSP_NAME)\\\""
108 DSP_PLATFORM = ti.platforms.evmTCI6630K2L:dsp
109 HOST_PLATFORM = ti.platforms.evmTCI6630K2L:host
110 BOARD_NAME = "evmK2L"
111 SERVER = "$(PROC_DSP_NAME)"
112 endif
114 EXBASE = .
115 include $(EXBASE)/products.mak
116 .PHONY: $(PROCLIST)
118 .PHONY: install install_rov
120 all: $(PROCLIST)
121         @echo $(PROCLIST)
123 $(PROCLIST):
124         @$(ECHO) "#"
125         @$(ECHO) "# Making $@ ..."
126         $(MAKE) -C $@ PROCLIST="$(PROCLIST)" \
127                 DSP_PLATFORM=$(DSP_PLATFORM) \
128                 HOST_PLATFORM=$(HOST_PLATFORM) \
129                 PROC_HOST_NAME="$(PROC_HOST_NAME)" \
130                 PROC_DSP_NAME="$(PROC_DSP_NAME)" \
131                 PROC_NAME_LIST=$(PROC_NAME_LIST) \
132                 BOARD_NAME="$(BOARD_NAME)" \
133                 SERVER="$(SERVER)"
135 #               IPU_PLATFORM=$(IPU_PLATFORM) \
136 #               PROC_IPU_NAME="$(PROC_IPU_NAME)" \
138 help:
139         @$(ECHO) "make                                  # build executables"
140         @$(ECHO) "make clean                            # clean everything"
141         @$(ECHO) "make install EXEC_DIR=/.../testbench  # install folder"
143 # setup install goal
144 ifeq ($(filter $(MAKECMDGOALS),install install_rov),$(MAKECMDGOALS))
145 ifeq (,$(EXEC_DIR))
146 EXEC_DIR=$(CURDIR)/install
147 endif
148 override EXEC_DIR:=$(EXEC_DIR)/simple_buffer_example
149 endif
151 install: $(PROCLIST) $(addsuffix _install,$(PROCLIST))
152 $(addsuffix _install,$(PROCLIST)):
153         @$(ECHO) "#"
154         @$(ECHO) "# Making $@ ..."
155 #       @$(MKDIR) $(EXEC_DIR)/debug
156         @$(MKDIR) $(EXEC_DIR)/release
157         $(MAKE) -C $(subst _install,,$@) EXEC_DIR=$(EXEC_DIR) install
159 install_rov: $(PROCLIST) $(addsuffix _install_rov,$(PROCLIST))
160 $(addsuffix _install_rov,$(PROCLIST)):
161         @$(ECHO) "#"
162         @$(ECHO) "# Making $@ ..."
163         @$(MKDIR) $(EXEC_DIR)/release
164         $(MAKE) -C $(subst _install_rov,,$@) EXEC_DIR=$(EXEC_DIR) install_rov
166 clean: $(addsuffix _clean,$(PROCLIST))
167         $(RMDIR) install
169 $(addsuffix _clean,$(PROCLIST)):
170         $(MAKE) -C $(subst _clean,,$@) clean
172 #  ======== standard macros ========
173 ifneq (,$(wildcard $(XDC_INSTALL_DIR)/xdc.exe))
174     # use these on Windows
175     CP      = $(XDC_INSTALL_DIR)/bin/cp
176     ECHO    = $(XDC_INSTALL_DIR)/bin/echo
177     INSTALL = $(XDC_INSTALL_DIR)/bin/cp
178     MKDIR   = $(XDC_INSTALL_DIR)/bin/mkdir -p
179     RM      = $(XDC_INSTALL_DIR)/bin/rm -f
180     RMDIR   = $(XDC_INSTALL_DIR)/bin/rm -rf
181 else
182     # use these on Linux
183     CP      = cp
184     ECHO    = echo
185     INSTALL = install
186     MKDIR   = mkdir -p
187     RM      = rm -f
188     RMDIR   = rm -rf
189 endif