1 ##\r
2 ## Copyright (c) 2018, Texas Instruments Incorporated\r
3 ##\r
4 ## Redistribution and use in source and binary forms, with or without\r
5 ## modification, are permitted provided that the following conditions\r
6 ## are met:\r
7 ##\r
8 ## * Redistributions of source code must retain the above copyright\r
9 ## notice, this list of conditions and the following disclaimer.\r
10 ##\r
11 ## * Redistributions in binary form must reproduce the above copyright\r
12 ## notice, this list of conditions and the following disclaimer in the\r
13 ## documentation and/or other materials provided with the distribution.\r
14 ##\r
15 ## * Neither the name of Texas Instruments Incorporated nor the names of\r
16 ## its contributors may be used to endorse or promote products derived\r
17 ## from this software without specific prior written permission.\r
18 ##\r
19 ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
20 ## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\r
21 ## THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
22 ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\r
23 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r
24 ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r
25 ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\r
26 ## OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\r
27 ## WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\r
28 ## OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
29 ## EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
30 ##\r
31 \r
32 # Path to C6000 compiler tools\r
33 ifeq ($(CGTROOT),)\r
34 $(call error,ERROR - CGTROOT NOT DEFINED)\r
35 endif\r
36 \r
37 ifeq ($(XDC_DIR),)\r
38 $(call error,ERROR - XDC_DIR NOT DEFINED)\r
39 endif\r
40 \r
41 ifeq ($(PASDK_BASE_DIR),)\r
42 PASDK_BASE_DIR := $(shell pwd)\r
43 endif\r
44 \r
45 ifeq ($(SRC_PATH),)\r
46 SRC_PATH = $(PASDK_BASE_DIR)/pasdk\r
47 endif\r
48 \r
49 \r
50 XDCPATH = $(PDK_DIR)/packages;$(OMP_DIR)/packages;$(BIOS_DIR)/packages;$(IPC_DIR)/packages;$(XDAIS_DIR)/packages;$(EDMA3_DIR)/packages;\r
51 \r
52 XDC=$(XDC_DIR)/xdc\r
53 XS=$(XDC_DIR)/xs\r
54 XDCPKG=$(XDC_DIR)/bin/xdcpkg\r
55 \r
56 COMPONENT_NAME = pasdk\r
57 VERSION = 1_2_0_0\r
58 \r
59 ifeq ($(TARGET),SOC_K2G)\r
60 target=k2g\r
61 else\r
62 $(call error, ERROR - TARGET NOT DEFINED. Must specify TARGET=SOC_K2G)\r
63 endif\r
64 \r
65 PACKAGE_NAME = ${COMPONENT_NAME}_${target}_${VERSION}\r
66 \r
67 all: package\r
68 \r
69 .lib:\r
70 \r
71 .eclipse: .exports\r
72 @echo creating product plugin\r
73 $(XDC) clean -P $(PASDK_BASE_DIR)/installer_builder/rtsc/eclipse\r
74 $(XDC) -P $(PASDK_BASE_DIR)/installer_builder/rtsc/eclipse\r
75 $(XS) --xdcpath "$(XDCPATH);$(PASDK_BASE_DIR)/installer_builder/rtsc" xdc.tools.product.plugingen -p exports/$(PACKAGE_NAME) -m eclipse.Product\r
76 \r
77 .exports:\r
78 @echo "making product directories ..."\r
79 @rm -f exports/$(PACKAGE_NAME).zip\r
80 @rm -rf exports/$(PACKAGE_NAME)\r
81 @mkdir -p exports/$(PACKAGE_NAME)\r
82 @mkdir -p exports/$(PACKAGE_NAME)/packages\r
83 @mkdir -p exports/$(PACKAGE_NAME)/packages/ti/pasdk\r
84 \r
85 .docs:\r
86 \r
87 package: .lib .docs .exports .eclipse\r
88 @echo "copying files ..."\r
89 @cp -R $(PASDK_BASE_DIR)/pasdk exports/$(PACKAGE_NAME)/packages/ti\r
90 @cp -R $(PASDK_PAF_DIR) exports/$(PACKAGE_NAME)/packages/ti\r
91 @echo "archive files to tar ball ..."\r
92 @cd exports; zip -q -r $(PACKAGE_NAME).zip $(PACKAGE_NAME)\r
93 \r
94 clean: \r
95 rm -r exports/$(PACKAGE_NAME); rm exports/$(PACKAGE_NAME).zip\r