1cdeefbae12c2cb4c2f1f6069a0c54b41297b550
[dense-linear-algebra-libraries/linalg.git] / build / Makefile
1 ##
2 ##  Copyright (c) 2015, 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 ##
31 ##  ======== Makefile.libs ========
32 ##
34 # Makefile to build the OpenMP DSP libraries for TCI6636KH, TMS320C6678,
35 # TMS320C6670 and TMS320C6657
37 #
38 # Environment variables that have to be set
39 #
41 # Path to C6000 compiler tools
42 ifeq ($(CGTROOT),)
43 $(call error,ERROR - CGTROOT NOT DEFINED)
44 endif
46 ifeq ($(XDC_DIR),)
47 $(call error,ERROR - XDC_DIR NOT DEFINED)
48 endif
50 ifeq ($(SRC_PATH),)
51 SRC_PATH = ../src
52 endif
54 LINALG_BASE_DIR = /home/a0869574local/proclibs/linalg_extgit/linalg_rtsc
56 XDCPATH = $(PDK_DIR)/packages;$(OMP_DIR)/packages;$(BIOS_DIR)/packages;$(IPC_DIR)/packages;$(FC_DIR)/packages;$(XDAIS_DIR)/packages;$(EDMA3_DIR)/packages;
58 XDC=$(XDC_DIR)/xdc
59 XS=$(XDC_DIR)/xs
60 XDCPKG=$(XDC_DIR)/bin/xdcpkg
62 PACKAGE_NAME = linalg_1_2_0_0
64 ifeq ($(LIBOS),LIB_RTOS)
65 else ifeq($(LIBOS),LIB_OPENCL)
66 else
67 $(call error, ERROR - LIBOS NOT DEFINED. Must specify one of: LIBOS=LIB_RTOS, or LIBOS=LIB_OPENCL)
68 endif
70 .DSPlibs:
71         cd $(LINALG_BASE_DIR)/src/ti/linalg; \
72         make DSPlibs MEM_MODEL=$(MEM_MODEL) TARGET=$(TARGET) LIBOS=$(LIBOS)
74 .platforms:
75         @echo "making platform directories ..."
76         $(XDC) clean --xdcpath="$(BIOS_DIR)/packages" -PR $(SRC_PATH)/ti/linalg/platforms
77         $(XDC) --xdcpath "$(XDCPATH)" -PR $(SRC_PATH)/ti/linalg/platforms
79 .eclipse: .exports
80         @echo creating product plugin
81         $(XDC) clean -P $(LINALG_BASE_DIR)/build/eclipse
82         $(XDC) -P $(LINALG_BASE_DIR)/build/eclipse
83         $(XS) --xdcpath "$(XDCPATH);$(LINALG_BASE_DIR)/build" xdc.tools.product.plugingen -p exports/$(PACKAGE_NAME) -m eclipse.Product
85 .exports:
86         @echo "making product directories ..."
87         @rm -f exports/$(PACKAGE_NAME).zip
88         @rm -rf exports/$(PACKAGE_NAME)
89         @mkdir -p exports/$(PACKAGE_NAME)
90         @mkdir -p exports/$(PACKAGE_NAME)/examples
91         @mkdir -p exports/$(PACKAGE_NAME)/packages
92         @mkdir -p exports/$(PACKAGE_NAME)/packages/build
93         @mkdir -p exports/$(PACKAGE_NAME)/packages/ti/linalg
94         @mkdir -p exports/$(PACKAGE_NAME)/docs
96 .docs:
97         @echo "generating Doxygen document"
98         cd $(LINALG_BASE_DIR)/src/ti/linalg; doxygen ./docs/doxygen/doxycfg.txt
100 #.product: .libs_c6678 .exports .docs .platforms .examples
101 DSPonlyRTOS: .DSPlibs .docs .platforms .exports .eclipse
102         @echo "copying files ..."
103         @cp -R $(LINALG_BASE_DIR)/src/ti/linalg/lib exports/$(PACKAGE_NAME)/packages/ti/linalg
104         cd $(LINALG_BASE_DIR)/src/ti/linalg; make cleanDSPlibs MEM_MODEL=$(MEM_MODEL); cd -
105         @cp    $(LINALG_BASE_DIR)/src/ti/linalg/ticblas/ticblas.h exports/$(PACKAGE_NAME)/packages/ti/linalg
106         @cp    $(LINALG_BASE_DIR)/src/ti/linalg/cblas/include/cblas.h exports/$(PACKAGE_NAME)/packages/ti/linalg
107         @cp -R $(LINALG_BASE_DIR)/src/ti/linalg/* exports/$(PACKAGE_NAME)/packages/ti/linalg
108         @cp -R $(LINALG_BASE_DIR)/src/ti/linalg/docs/linalg_user_guide.html exports/$(PACKAGE_NAME)/docs/ 
109         @cp -R $(LINALG_BASE_DIR)/src/ti/linalg/docs/doxygen/html exports/$(PACKAGE_NAME)/docs/ 
110         @cp -R $(LINALG_BASE_DIR)/examples/dsponly/* exports/$(PACKAGE_NAME)/examples/
111         @cp $(LINALG_BASE_DIR)/build/Makefile exports/$(PACKAGE_NAME)/packages/build/
112         @echo "archive files to tar ball ..."
113         @cd exports; zip -q -r $(PACKAGE_NAME).zip $(PACKAGE_NAME)
115 ARMplusDSP:
116         cd $(LINALG_BASE_DIR)/src/ti/linalg; \
117         make ARMplusDSP MEM_MODEL=$(MEM_MODEL) TARGET=$(TARGET) LIBOS=$(LIBOS)
119 installARMplusDSPlib:
120         cd $(LINALG_BASE_DIR)/src/ti/linalg; \
121         make installARMplusDSPlib DESTDIR=$(DESTDIR)