]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/big-data-ipc-examples.git/blob - host_bios/simple_buffer_example/dsp/makefile
makefile: Update configuro directory and comment debug build
[processor-sdk/big-data-ipc-examples.git] / host_bios / simple_buffer_example / dsp / 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 EXBASE = ..
38 include $(EXBASE)/products.mak
40 srcs = MainDsp.c Server.c
41 objs = $(addprefix bin/$(PLATFORM)/$(PROFILE)/obj/,$(patsubst %.c,%.oe66,$(srcs)))
42 CONFIG = bin/$(PLATFORM)/$(PROFILE)/configuro
44 PKGPATH := $(BIOS_INSTALL_DIR)/packages
45 PKGPATH := $(PKGPATH)+$(IPC_INSTALL_DIR)/packages
46 PKGPATH := $(PKGPATH)+$(XDC_INSTALL_DIR)/packages
48 -include $(addprefix bin/$(PLATFORM)/$(PROFILE)/obj/,$(patsubst %.c,%.oe66.dep,$(srcs)))
50 .PRECIOUS: %/compiler.opt %/linker.cmd
52 all: release
54 debug:
55         echo Building debug
56         $(MAKE) PROFILE=debug server_dsp.x
58 release:
59         $(MAKE) PROFILE=release server_dsp.x
61 server_dsp.x: bin/$(PLATFORM)/$(PROFILE)/server_dsp.xe66
62         echo executing server_dsp.x
64 bin/$(PLATFORM)/$(PROFILE)/server_dsp.xe66: $(objs) $(libs) $(CONFIG)/linker.cmd
65         @$(ECHO) "#"
66         @$(ECHO) "# Making $@ ..."
67         $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
69 bin/$(PLATFORM)/$(PROFILE)/obj/%.oe66: %.c $(CONFIG)/compiler.opt
70         @$(ECHO) "#"
71         @$(ECHO) "# Making $@ ..."
72         $(CC) $(CPPFLAGS) $(CFLAGS) --output_file=$@ -fc $<
74 %/compiler.opt: %/linker.cmd ;
75 %/linker.cmd: Dsp.cfg ../shared/$(PLATFORM)/config.bld
76         @$(ECHO) "#"
77         @$(ECHO) "# Making $@ ..."
78         $(XDC_INSTALL_DIR)/xs --xdcpath="$(subst +,;,$(PKGPATH))" \
79             xdc.tools.configuro -o $(CONFIG) \
80             -t ti.targets.elf.C66 \
81             -c $(ti.targets.elf.C66) \
82             -p $(DSP_PLATFORM) \
83             -b ../shared/$(PLATFORM)/config.bld -r $(PROFILE) \
84             --cfgArgs "{ \
85                 procnamelist: [$(PROC_NAME_LIST)], \
86                 procname: \"$(PROC_DSP_NAME)\", \
87                 profile: \"$(PROFILE)\" \
88             }" \
89             Dsp.cfg
91 install:
92         @$(ECHO) "#"
93         @$(ECHO) "# Making $@ ..."
94 #       @$(MKDIR) $(EXEC_DIR)/debug
95 #       $(CP) bin/$(PLATFORM)/debug/server_dsp.xe66 $(EXEC_DIR)/debug
96         @$(MKDIR) $(EXEC_DIR)/release
97         $(CP) bin/$(PLATFORM)/release/server_dsp.xe66 $(EXEC_DIR)/release
99 help:
100         @$(ECHO) "make                   # build executable"
101         @$(ECHO) "make clean             # clean everything"
103 clean::
104         $(RMDIR) bin
106 #  ======== install validation ========
107 ifeq (install,$(MAKECMDGOALS))
108 ifeq (,$(EXEC_DIR))
109 $(error must specify EXEC_DIR)
110 endif
111 endif
113 #  ======== toolchain macros ========
114 CGTOOLS = $(ti.targets.elf.C66)
116 CC = $(CGTOOLS)/bin/cl6x -c
117 LD = $(CGTOOLS)/bin/cl6x -z
119 CPPFLAGS =
120 CFLAGS = -qq -pdsw225 -ppd=$@.dep -ppa $(CCPROFILE_$(PROFILE)) -@$(CONFIG)/compiler.opt -I.
122 LDFLAGS = -w -q -c -m $(@D)/obj/$(@F).map
123 LDLIBS = -l $(CGTOOLS)/lib/rts6600_elf.lib
125 CCPROFILE_debug = -D_DEBUG_=1 --symdebug:dwarf
126 CCPROFILE_release = -O2
128 #  ======== standard macros ========
129 ifneq (,$(wildcard $(XDC_INSTALL_DIR)/xdc.exe))
130     # use these on Windows
131     CP      = $(XDC_INSTALL_DIR)/bin/cp
132     ECHO    = $(XDC_INSTALL_DIR)/bin/echo
133     MKDIR   = $(XDC_INSTALL_DIR)/bin/mkdir -p
134     RM      = $(XDC_INSTALL_DIR)/bin/rm -f
135     RMDIR   = $(XDC_INSTALL_DIR)/bin/rm -rf
136 else
137     # use these on Linux
138     CP      = cp
139     ECHO    = echo
140     MKDIR   = mkdir -p
141     RM      = rm -f
142     RMDIR   = rm -rf
143 endif
145 #  ======== create output directories ========
146 ifneq (clean,$(MAKECMDGOALS))
147 ifneq (,$(PROFILE))
148 ifeq (,$(wildcard bin/$(PLATFORM)/$(PROFILE)/obj))
149     $(shell $(MKDIR) -p bin/$(PLATFORM)/$(PROFILE)/obj)
150 endif
151 endif
152 endif