makefile: Add install rov to allow debugging
[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),TCI6638)
53 PROCLIST = host dsp
54 PROC_HOST_NAME = "HOST"
55 PROC_DSP_NAME = "CORE0"
56 PROC_NAME_LIST = "\\\"$(PROC_HOST_NAME)\\\", \\\"$(PROC_DSP_NAME)\\\""
57 DSP_PLATFORM = ti.platforms.evmTCI6638K2K:dsp
58 HOST_PLATFORM = ti.platforms.evmTCI6638K2K:host
59 SERVER = "$(PROC_DSP_NAME)"
60 BOARD_NAME = "evmK2K"
61 else ifeq ($(PLATFORM),TCI6636)
62 PROCLIST = host dsp
63 PROC_HOST_NAME = "HOST"
64 PROC_DSP_NAME = "CORE0"
65 PROC_NAME_LIST = "\\\"$(PROC_HOST_NAME)\\\", \\\"$(PROC_DSP_NAME)\\\""
66 DSP_PLATFORM = ti.platforms.evmTCI6636K2H:dsp
67 HOST_PLATFORM = ti.platforms.evmTCI6636K2H:host
68 SERVER = "$(PROC_DSP_NAME)"
69 BOARD_NAME = "evmK2H"
70 else ifeq ($(PLATFORM),66AK2G)
71 PROCLIST = host dsp
72 PROC_HOST_NAME = "HOST"
73 PROC_DSP_NAME = "CORE0"
74 PROC_NAME_LIST = "\\\"$(PROC_HOST_NAME)\\\", \\\"$(PROC_DSP_NAME)\\\""
75 DSP_PLATFORM = ti.platforms.evmTCI66AK2G02:dsp
76 HOST_PLATFORM = ti.platforms.evmTCI66AK2G02:host
77 BOARD_NAME = "evmK2G"
78 SERVER = "$(PROC_DSP_NAME)"
79 else ifeq ($(PLATFORM),66AK2E)
80 PROCLIST = host dsp
81 PROC_HOST_NAME = "HOST"
82 PROC_DSP_NAME = "CORE0"
83 PROC_NAME_LIST = "\\\"$(PROC_HOST_NAME)\\\", \\\"$(PROC_DSP_NAME)\\\""
84 DSP_PLATFORM = ti.platforms.evmC66AK2E:dsp
85 HOST_PLATFORM = ti.platforms.evmC66AK2E:host
86 BOARD_NAME = "evmK2E"
87 SERVER = "$(PROC_DSP_NAME)"
88 endif
90 EXBASE = .
91 include $(EXBASE)/products.mak
92 .PHONY: $(PROCLIST)
94 .PHONY: install
96 all: $(PROCLIST)
98 $(PROCLIST):
99         @$(ECHO) "#"
100         @$(ECHO) "# Making $@ ..."
101         $(MAKE) -C $@ PROCLIST="$(PROCLIST)" \
102                 DSP_PLATFORM=$(DSP_PLATFORM) \
103                 HOST_PLATFORM=$(HOST_PLATFORM) \
104                 PROC_HOST_NAME="$(PROC_HOST_NAME)" \
105                 PROC_DSP_NAME="$(PROC_DSP_NAME)" \
106                 PROC_NAME_LIST=$(PROC_NAME_LIST) \
107                 BOARD_NAME="$(BOARD_NAME)" \
108                 SERVER="$(SERVER)"
110 #               IPU_PLATFORM=$(IPU_PLATFORM) \
111 #               PROC_IPU_NAME="$(PROC_IPU_NAME)" \
113 help:
114         @$(ECHO) "make                                  # build executables"
115         @$(ECHO) "make clean                            # clean everything"
116         @$(ECHO) "make install EXEC_DIR=/.../testbench  # install folder"
118 # setup install goal
119 ifeq ($(filter $(MAKECMDGOALS),install install_rov),$(MAKECMDGOALS))
120 ifeq (,$(EXEC_DIR))
121 EXEC_DIR=$(CURDIR)/install
122 endif
123 override EXEC_DIR:=$(EXEC_DIR)/simple_buffer_example
124 endif
126 install: $(PROCLIST) $(addsuffix _install,$(PROCLIST))
127 $(addsuffix _install,$(PROCLIST)):
128         @$(ECHO) "#"
129         @$(ECHO) "# Making $@ ..."
130 #       @$(MKDIR) $(EXEC_DIR)/debug
131         @$(MKDIR) $(EXEC_DIR)/release
132         $(MAKE) -C $(subst _install,,$@) EXEC_DIR=$(EXEC_DIR) install
134 install_rov: $(PROCLIST) $(addsuffix _install,$(PROCLIST))
135 $(addsuffix _install_rov,$(PROCLIST)):
136         @$(ECHO) "#"
137         @$(ECHO) "# Making $@ ..."
138         @$(MKDIR) $(EXEC_DIR)/release
139         $(MAKE) -C $(subst _install_rov,,$@) EXEC_DIR=$(EXEC_DIR) install_rov
142 clean: $(addsuffix _clean,$(PROCLIST))
143         $(RMDIR) install
145 $(addsuffix _clean,$(PROCLIST)):
146         $(MAKE) -C $(subst _clean,,$@) clean
148 #  ======== standard macros ========
149 ifneq (,$(wildcard $(XDC_INSTALL_DIR)/xdc.exe))
150     # use these on Windows
151     CP      = $(XDC_INSTALL_DIR)/bin/cp
152     ECHO    = $(XDC_INSTALL_DIR)/bin/echo
153     INSTALL = $(XDC_INSTALL_DIR)/bin/cp
154     MKDIR   = $(XDC_INSTALL_DIR)/bin/mkdir -p
155     RM      = $(XDC_INSTALL_DIR)/bin/rm -f
156     RMDIR   = $(XDC_INSTALL_DIR)/bin/rm -rf
157 else
158     # use these on Linux
159     CP      = cp
160     ECHO    = echo
161     INSTALL = install
162     MKDIR   = mkdir -p
163     RM      = rm -f
164     RMDIR   = rm -rf
165 endif