9388872e585ac75f7854cecf77599d85e63be9ac
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 locallibsrcs = shared/bigdataxlat/bios/bigdataxlat.c
45 locallibobjs = $(addprefix bin/shared/$(PLATFORM)/$(PROFILE)/obj/,$(patsubst %.c,%.oe66,$(locallibsrcs)))
47 PKGPATH := $(BIOS_INSTALL_DIR)/packages
48 PKGPATH := $(PKGPATH)+$(IPC_INSTALL_DIR)/packages
49 PKGPATH := $(PKGPATH)+$(XDC_INSTALL_DIR)/packages
51 -include $(addprefix bin/$(PLATFORM)/$(PROFILE)/obj/,$(patsubst %.c,%.oe66.dep,$(srcs)))
52 -include $(addprefix bin/shared/$(PLATFORM)/$(PROFILE)/obj/,$(patsubst %.c,%.oe66.dep,$(locallibsrcs)))
54 .PRECIOUS: %/compiler.opt %/linker.cmd
55 .PHONY: release debug install install_rov server_dsp.x
57 all: release
59 debug:
60 echo Building debug
61 $(MAKE) PROFILE=debug server_dsp.x
63 release:
64 $(MAKE) PROFILE=release server_dsp.x
66 server_dsp.x: bin/$(PLATFORM)/$(PROFILE)/server_dsp.xe66
68 bin/$(PLATFORM)/$(PROFILE)/server_dsp.xe66: $(objs) $(locallibobjs) $(libs) $(CONFIG)/linker.cmd
69 @$(ECHO) "#"
70 @$(ECHO) "# Making $@ ..."
71 $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
73 bin/$(PLATFORM)/$(PROFILE)/obj/%.oe66: %.c $(CONFIG)/compiler.opt
74 @$(ECHO) "#"
75 @$(ECHO) "# Making $@ ..."
76 $(CC) $(CPPFLAGS) $(CFLAGS) --output_file=$@ -fc $<
78 bin/shared/$(PLATFORM)/$(PROFILE)/obj/%.oe66: ../%.c $(CONFIG)/compiler.opt
79 @$(ECHO) "#"
80 @$(ECHO) "# Making $@ ..."
81 $(CC) $(CPPFLAGS) $(CFLAGS) --output_file=$@ -fc $<
83 %/compiler.opt %/linker.cmd: Dsp.cfg ../shared/$(PLATFORM)/config.bld
84 @$(ECHO) "#"
85 @$(ECHO) "# Making $@ ..."
86 $(XDC_INSTALL_DIR)/xs --xdcpath="$(subst +,;,$(PKGPATH))" \
87 xdc.tools.configuro -o $(CONFIG) \
88 -t ti.targets.elf.C66 \
89 -c $(ti.targets.elf.C66) \
90 -p $(DSP_PLATFORM) \
91 -b ../shared/$(PLATFORM)/config.bld -r $(PROFILE) \
92 --cfgArgs "{ \
93 procnamelist: [$(PROC_NAME_LIST)], \
94 procname: \"$(PROC_DSP_NAME)\", \
95 profile: \"$(PROFILE)\" \
96 }" \
97 Dsp.cfg
99 install:
100 @$(ECHO) "#"
101 @$(ECHO) "# Making $@ ..."
102 # @$(MKDIR) $(EXEC_DIR)/debug
103 # $(CP) bin/$(PLATFORM)/debug/server_dsp.xe66 $(EXEC_DIR)/debug
104 @$(MKDIR) $(EXEC_DIR)/release
105 $(CP) bin/$(PLATFORM)/release/server_dsp.xe66 $(EXEC_DIR)/release
107 install_rov:
108 @$(ECHO) "#"
109 @$(ECHO) "# Making $@ ..."
110 @$(MKDIR) $(EXEC_DIR)/release
111 $(CP) bin/$(PLATFORM)/release/configuro/package/cfg/Dsp_pe66.rov.xs $(EXEC_DIR)/release
113 help:
114 @$(ECHO) "make # build executable"
115 @$(ECHO) "make clean # clean everything"
117 clean::
118 $(RMDIR) bin
120 # ======== install validation ========
121 ifeq (install,$(MAKECMDGOALS))
122 ifeq (,$(EXEC_DIR))
123 $(error must specify EXEC_DIR)
124 endif
125 endif
127 # ======== toolchain macros ========
128 CGTOOLS = $(ti.targets.elf.C66)
130 CC = $(CGTOOLS)/bin/cl6x -c
131 LD = $(CGTOOLS)/bin/cl6x -z
133 CPPFLAGS =
134 CFLAGS = -qq -pdsw225 -ppd=$@.dep -ppa $(CCPROFILE_$(PROFILE)) -@$(CONFIG)/compiler.opt -I.
135 CFLAGS += -I../shared/bigdataxlat/bios
137 LDFLAGS = -w -q -c -m $(@D)/obj/$(@F).map
138 LDLIBS = -l $(CGTOOLS)/lib/rts6600_elf.lib
140 CCPROFILE_debug = -D_DEBUG_=1 --symdebug:dwarf
141 CCPROFILE_release = -O2
143 # ======== standard macros ========
144 ifneq (,$(wildcard $(XDC_INSTALL_DIR)/xdc.exe))
145 # use these on Windows
146 CP = $(XDC_INSTALL_DIR)/bin/cp
147 ECHO = $(XDC_INSTALL_DIR)/bin/echo
148 MKDIR = $(XDC_INSTALL_DIR)/bin/mkdir -p
149 RM = $(XDC_INSTALL_DIR)/bin/rm -f
150 RMDIR = $(XDC_INSTALL_DIR)/bin/rm -rf
151 else
152 # use these on Linux
153 CP = cp
154 ECHO = echo
155 MKDIR = mkdir -p
156 RM = rm -f
157 RMDIR = rm -rf
158 endif
160 # ======== create output directories ========
161 ifneq (clean,$(MAKECMDGOALS))
162 ifneq (,$(PROFILE))
163 ifeq (,$(wildcard bin/$(PLATFORM)/$(PROFILE)/obj))
164 $(shell $(MKDIR) -p bin/$(PLATFORM)/$(PROFILE)/obj)
165 endif
166 ifeq (,$(wildcard bin/shared/$(PLATFORM)/$(PROFILE)/obj/shared/bigdataxlat/bios))
167 $(shell $(MKDIR) -p bin/shared/$(PLATFORM)/$(PROFILE)/obj/shared/bigdataxlat/bios)
168 endif
169 endif
170 endif