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