]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blob - pdk_k2g_1_0_1_0_eng/packages/ti/boot/sbl/example/ipu1MulticoreApp/makefile
Change pdk_k2g_1_0_1 directory name in preparation for updating RSTC plugin
[processor-sdk/performance-audio-sr.git] / pdk_k2g_1_0_1_0_eng / packages / ti / boot / sbl / example / ipu1MulticoreApp / 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 m4 - This file has all the common rules and defines required
38 #                     for Cortex-M4 ISA
39 #
40 # This file needs to change when:
41 #     1. Code generation tool chain changes
42 #     2. Internal switches (which are normally not touched) has to change
43 #     3. XDC specific switches change
44 #     4. a rule common for M4 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 = m4
53 ARCH = armv7m
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_M4_OBJDIR = $(SBL_SRC_DIR)/binary/$(BOARD)/example/m4/ipu1/obj
70 SBL_M4_BINDIR = $(SBL_SRC_DIR)/binary/$(BOARD)/example/m4/ipu1/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 = $(TOOLCHAIN_PATH_M4)/include
79 CC = $(TOOLCHAIN_PATH_M4)/bin/armcl
80 AR = $(TOOLCHAIN_PATH_M4)/bin/armar
81 LNK = $(TOOLCHAIN_PATH_M4)/bin/armcl
82 LD = $(TOOLCHAIN_PATH_M4)/bin/armcl
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 M4_CFLAGS_INTERNAL = -c -qq -pdsw225 --endian=$(ENDIAN) -mv7M4 --float_support=vfplib --abi=$(CSWITCH_FORMAT) -eo.$(OBJEXT) -ea.$(ASMEXT) -DSOC_$(SOC) --symdebug:dwarf --embed_inline_assembly
104 # Path of the RTS library - normally doesn't change for a given tool-chain
105 #Let the linker choose the required library
106  RTSLIB_PATH = $(TOOLCHAIN_PATH_M4)/lib/libc.a
107  LIB_PATHS += $(RTSLIB_PATH)
108  LNK_LIBS = $(addprefix -l,$(LIB_PATHS))
109  LNKCMD_FILE = $(SBL_SRC_DIR)/example/ipu1MulticoreApp/lnk_cpu0.cmd
111  INTERNALLINKDEFS = --silicon_version=7M4 --run_linker -w -q -u _c_int00 -c --dynamic
113 # INCLUDE Directories
114 SBL_SOC_DIR = $(SBL_SRC_DIR)/soc/am57xx
116 DEPDIR = $(SBL_M4_OBJDIR)/.deps
117 DEPFILE = $(DEPDIR)/$(*F)
119 SRCDIR = $(SBL_SRC_DIR)/example/ipu1MulticoreApp
121 INCLUDES = -I$(PDK_INSTALL_PATH) -I$(SBL_SOC_DIR) -I$(TOOLCHAIN_PATH_M4)/include
123 # Executable using device independent library and device object file
124 EXE=sbl_app.$(EXEEXT)
126 VPATH=$(SRCDIR):$(SBL_SRC_DIR)/soc/am57xx
128 #List the Source Files
129 SRC_C = \
130         sbl_multicore_cpu0.c \
131         mailbox.c
133 # Make Rule for the SRC Files
134 SRC_OBJS = $(patsubst %.c, $(SBL_M4_OBJDIR)/%.$(OBJEXT), $(SRC_C))
136 example:$(SBL_M4_BINDIR)/$(EXE)
138 $(SBL_M4_BINDIR)/$(EXE): $(SRC_OBJS) $(SBL_M4_BINDIR)/.created $(SBL_M4_OBJDIR)/.created
139         @echo linking $(SRC_OBJS) into $@ ...
140         $(LNK) $(SRC_OBJS) $(INTERNALLINKDEFS) $(LNKCMD_FILE) -o $@ -m $@.map $(LNK_LIBS)
142 $(SBL_M4_OBJDIR)/%.$(OBJEXT): %.c $(SBL_M4_OBJDIR)/.created
143         @echo compiling $< ...
144         $(CC) $(M4_CFLAGS_INTERNAL) $(INCLUDES) -fr=$(SBL_M4_OBJDIR) -fs=$(SBL_M4_OBJDIR) -fc $<
146 $(SBL_M4_OBJDIR)/.created:
147         @mkdir -p $(SBL_M4_OBJDIR)
148         @touch $(SBL_M4_OBJDIR)/.created
150 $(SBL_M4_BINDIR)/.created:
151         @mkdir -p $(SBL_M4_BINDIR)
152         @touch $(SBL_M4_BINDIR)/.created
154 example_clean:
155         @rm -f $(SBL_M4_BINDIR)/$(EXE)
156         @rm -f $(SRC_OBJS) $(SBL_M4_BINDIR)/.created $(SBL_M4_OBJDIR)/.created