1 #
2 # Copyright (c) 2012-2014, Texas Instruments Incorporated
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 distribution.
14 #
15 # * Neither the name of Texas Instruments Incorporated nor the names of
16 # its contributors may be used to endorse or promote products derived
17 # from this software without specific prior written permission.
18 #
19 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21 # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
23 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
26 # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
28 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #
32 #
33 # Where to install/stage the packages
34 # Typically this would point to the devkit location
35 #
36 DESTDIR ?= <UNDEFINED>
38 packagesdir ?= /packages
39 libdir ?= /lib
40 includedir ?= /include
42 ifeq ($(docdir),)
43 docdir := /share/ti/framework_components/doc
44 packagedocdir := /docs/framework_components
45 else
46 packagedocdir := $(docdir)
47 endif
49 ifeq ($(prefix),)
50 prefix := /usr
51 packageprefix := /
52 else
53 packageprefix := $(prefix)
54 endif
56 include ./products.mak
58 #
59 # Set XDCOPTIONS. Use -v for a verbose build.
60 #
61 #XDCOPTIONS=v
62 export XDCOPTIONS
64 # Set XDCARGS to some of the variables above. XDCARGS are passed
65 # to the XDC build engine... which will load ipc-bios.bld... which will
66 # extract these variables and use them to determine what to build and which
67 # toolchains to use.
68 #
69 # Note that not all of these variables need to be set to something valid.
70 # Unfortunately, since these vars are unconditionally assigned, your build line
71 # will be longer and more noisy than necessary (e.g., it will include C66
72 # assignment even if you're just building for C64P).
73 #
74 # Some background is here:
75 # http://rtsc.eclipse.org/docs-tip/Command_-_xdc#Environment_Variables
76 #
77 XDCARGS= \
78 PLATFORM=\"$(PLATFORM)\" \
79 BIOS_SMPENABLED=\"$(BIOS_SMPENABLED)\" \
80 ti.targets.C64P=\"$(ti.targets.C64P)\" \
81 ti.targets.C674=\"$(ti.targets.C674)\" \
82 ti.targets.arm.elf.M3=\"$(ti.targets.arm.elf.M3)\" \
83 ti.targets.arm.elf.M4=\"$(ti.targets.arm.elf.M4)\" \
84 ti.targets.elf.C64P=\"$(ti.targets.elf.C64P)\" \
85 ti.targets.elf.C64T=\"$(ti.targets.elf.C64T)\" \
86 ti.targets.elf.C66=\"$(ti.targets.elf.C66)\" \
87 ti.targets.elf.C66_big_endian=\"$(ti.targets.elf.C66_big_endian)\" \
88 ti.targets.elf.C674=\"$(ti.targets.elf.C674)\"
90 #
91 # Get list of packages to rebuild. Using LIST allows SDKs to only build
92 # a subset of packages if they want to. Default behavior builds all
93 # packages.
94 #
95 LIST = $(shell $(XDC_INSTALL_DIR)/bin/xdcpkg ./packages)
97 # Set XDCPATH to contain necessary repositories.
98 XDCPATH = $(XDAIS_INSTALL_DIR)/packages;$(BIOS_INSTALL_DIR)/packages;$(EDMA3_LLD_INSTALL_DIR)/packages
99 export XDCPATH
101 #
102 # Set XDC executable command
103 # Note that XDCBUILDCFG points to the fc.bld file which uses
104 # the arguments specified by XDCARGS
105 #
106 XDC = $(XDC_INSTALL_DIR)/xdc XDCARGS="$(XDCARGS)" XDCBUILDCFG=./fc.bld
108 ######################################################
109 ## Shouldnt have to modify anything below this line ##
110 ######################################################
112 all:
113 @ echo building packages ...
114 @ $(XDC) -P $(LIST)
116 libs:
117 @echo "#"
118 @echo "# Making $@ ..."
119 $(XDC) .libraries -P $(LIST)
120 # $(XDC) .dlls -P $(LIST)
121 misraListErrors packages/misra > misraReport.txt
123 release:
124 @ echo releasing packages ...
125 @ $(XDC) release -P $(LIST)
127 # This cleans all packages rooted in ./packages
128 clean:
129 @ echo cleaning fc packages ...
130 @ $(XDC) clean -Pr ./packages
132 install-packages:
133 @ echo installing packages to $(DESTDIR) ...
134 @ mkdir -p $(DESTDIR)/$(packageprefix)/$(packagedocdir)
135 @ cp -rf $(wildcard ipc_*_release_notes.html) docs/* $(DESTDIR)/$(packageprefix)/$(packagedocdir)
136 @ mkdir -p $(DESTDIR)/$(packageprefix)/$(packagesdir)
137 @ cp -rf packages/* $(DESTDIR)/$(packageprefix)/$(packagesdir)
139 # Nothing for this Linux goal
140 install: