]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blob - pdk_k2g_1_0_1/packages/ti/boot/sbl/example/dsp2MulticoreApp/makefile
Add pdk folder
[processor-sdk/performance-audio-sr.git] / pdk_k2g_1_0_1 / packages / ti / boot / sbl / example / dsp2MulticoreApp / makefile
1 # Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
2 #
3 #
4 #  Redistribution and use in source and binary forms, with or without
5 #  modification, are permitted provided that the following conditions
6 #  are met:
7 #
8 #    Redistributions of source code must retain the above copyright
9 #    notice, this list of conditions and the following disclaimer.
10 #
11 #    Redistributions in binary form must reproduce the above copyright
12 #    notice, this list of conditions and the following disclaimer in the
13 #    documentation and/or other materials provided with the
14 #    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
21 #  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 #  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 #  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 #  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 #  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 #  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 #  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 #  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 #  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 #  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #
33 # Macro definitions referenced below
34 #
36 #
37 # Make rules for c66x - This file has all the common rules and defines required
38 #                     for c66x ISA
39 #
40 # This file needs to change when:
41 #     1. Code generation tool chain changes (currently it uses CG600_7.2.0.B2)
42 #     2. Internal switches (which are normally not touched) has to change
43 #     3. XDC specific switches change
44 #     4. a rule common for C66 ISA has to be added or modified
46 # Endianness : Allowed values = little | big
47 ENDIAN = little
49 # Format : Allowed values = COFF | ELF
50 FORMAT = ELF
52 ISA = 66
53 ARCH = c66x
55 #
56 # Derive XDC/ISA specific settings
57 #
58 ifeq ($(FORMAT),ELF)
59   FORMAT_EXT = e
60 endif
62 # If ENDIAN is set to "big", set ENDIAN_EXT to "e", that would be used in
63 #    in the filename extension of object/library/executable files
64 ifeq ($(ENDIAN),big)
65   ENDIAN_EXT = e
66 endif
68 SBL_SRC_DIR ?= $(PDK_INSTALL_PATH)/ti/boot/sbl
69 SBL_DSP_OBJDIR = $(SBL_SRC_DIR)/binary/$(BOARD)/example/c66/dsp2/obj
70 SBL_DSP_BINDIR = $(SBL_SRC_DIR)/binary/$(BOARD)/example/c66/dsp2/bin
72 OBJEXT = o$(FORMAT_EXT)$(ISA)$(ENDIAN_EXT)
73 LIBEXT = a$(FORMAT_EXT)$(ISA)$(ENDIAN_EXT)
74 EXEEXT = x$(FORMAT_EXT)$(ISA)$(ENDIAN_EXT)
75 ASMEXT = s$(FORMAT_EXT)$(ISA)$(ENDIAN_EXT)
77 # Set compiler/archiver/linker commands and include paths
78 CODEGEN_INCLUDE = $(C6X_GEN_INSTALL_PATH)/include
79 CC = $(C6X_GEN_INSTALL_PATH)/bin/cl6x -c
80 AR = $(C6X_GEN_INSTALL_PATH)/bin/ar6x
81 LNK = $(C6X_GEN_INSTALL_PATH)/bin/lnk6x
82 LD = $(C6X_GEN_INSTALL_PATH)/bin/lnk6x
84 # Derive a part of RTS Library name based on ENDIAN: little/big
85 ifeq ($(ENDIAN),little)
86   RTSLIB_ENDIAN =
87 else
88   RTSLIB_ENDIAN = e
89 endif
91 # Derive compiler switch and part of RTS Library name based on FORMAT: COFF/ELF
92 ifeq ($(FORMAT),COFF)
93   CSWITCH_FORMAT = ti_arm9_abi
94   RTSLIB_FORMAT = _tiarm9
95 endif
96 ifeq ($(FORMAT),ELF)
97   CSWITCH_FORMAT = eabi
98   RTSLIB_FORMAT = _elf
99 endif
101 # Internal CFLAGS - normally doesn't change
102 C66_CFLAGS_INTERNAL = -qq -pdsw225 --endian=$(ENDIAN) -mv6600 --abi=$(CSWITCH_FORMAT) -eo.$(OBJEXT) -ea.$(ASMEXT) -mi10 -mo -pdr -pden -pds=238 -pds=880 -pds1110 --program_level_compile -g -DSOC_$(SOC) -ppa -ppd=$@.dep
104 LNKFLAGS_INTERNAL_PROFILE =
105 C66_CFLAGS_INTERNAL += -O2 --optimize_with_debug --diag_wrap=off --preproc_with_compile
106 LNKFLAGS_GLOBAL_c66x = -x --zero_init=on --retain=_vectors
108 # Path of the RTS library - normally doesn't change for a given tool-chain
109 #Let the linker choose the required library
110  RTSLIB_PATH = $(C6X_GEN_INSTALL_PATH)/lib/libc.a
111  LIB_PATHS += $(RTSLIB_PATH)
112  LNK_LIBS = $(addprefix -l,$(LIB_PATHS))
113  LNKCMD_FILE = $(SBL_SRC_DIR)/example/dsp2MulticoreApp/lnk_dsp2.cmd
115  INTERNALLINKDEFS = -w -q -u _c_int00 --silicon_version=6600 -c --dynamic
117  INTERNALLINKDEFS += $(LNKFLAGS_GLOBAL_c66x)
119 # INCLUDE Directories
120 SBL_SOC_DIR = $(SBL_SRC_DIR)/soc/am57xx
122 DEPDIR = $(SBL_DSP_OBJDIR)/.deps
123 DEPFILE = $(DEPDIR)/$(*F)
125 SRCDIR = $(SBL_SRC_DIR)/example/dsp2MulticoreApp
126 #INCDIR = $(CSL_DIR) $(SBL_DSP_DIR) $(C6X_GEN_INSTALL_PATH)/include
128 INCLUDES = -I$(PDK_INSTALL_PATH) -I$(SBL_SOC_DIR) -I$(C6X_GEN_INSTALL_PATH)/include
130 # Executable using device independent library and device object file
131 EXE=sbl_app.$(EXEEXT)
133 VPATH=$(SRCDIR):$(SBL_SRC_DIR)/soc/am57xx
135 #List the Source Files
136 SRC_C = \
137         sbl_multicore_dsp2.c \
138         mailbox.c
140 # Make Rule for the SRC Files
141 SRC_OBJS = $(patsubst %.c, $(SBL_DSP_OBJDIR)/%.$(OBJEXT), $(SRC_C))
143 example:$(SBL_DSP_BINDIR)/$(EXE)
145 $(SBL_DSP_BINDIR)/$(EXE): $(SRC_OBJS) $(SBL_DSP_BINDIR)/.created $(SBL_DSP_OBJDIR)/.created
146         @echo linking $(SRC_OBJS) into $@ ...
147         $(LNK) $(SRC_OBJS) $(INTERNALLINKDEFS) $(LNKCMD_FILE) -o $@ -m $@.map $(LNK_LIBS)
149 $(SBL_DSP_OBJDIR)/%.$(OBJEXT): %.c $(SBL_DSP_OBJDIR)/.created
150         @echo compiling $< ...
151         #$(CC) -ppd=$(DEPFILE).P $(C66_CFLAGS_INTERNAL) $(INCLUDES) -fr=$(SBL_DSP_OBJDIR) -fs=$(SBL_DSP_OBJDIR) -fc $<
152         $(CC) $(C66_CFLAGS_INTERNAL) $(INCLUDES) -fr=$(SBL_DSP_OBJDIR) -fs=$(SBL_DSP_OBJDIR) -fc $<
154 $(SBL_DSP_OBJDIR)/.created:
155         @mkdir -p $(SBL_DSP_OBJDIR)
156         @touch $(SBL_DSP_OBJDIR)/.created
158 $(SBL_DSP_BINDIR)/.created:
159         @mkdir -p $(SBL_DSP_BINDIR)
160         @touch $(SBL_DSP_BINDIR)/.created
162 example_clean:
163         @rm -f $(SBL_DSP_BINDIR)/$(EXE)
164         @rm -f $(SRC_OBJS) $(SBL_DSP_BINDIR)/.created $(SBL_DSP_OBJDIR)/.created