]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - dense-linear-algebra-libraries/linalg.git/blob - make.inc
Integrated linalg into Proc-SDK RTOS.
[dense-linear-algebra-libraries/linalg.git] / make.inc
1 #DSP_INCLUDE  = -I$(TI_OCL_CGT_INSTALL)/include 
2 #DSP_INCLUDE += -I$(TARGET_ROOTDIR)/usr/share/ti/cgt-c6x/include
3 #DSP_INCLUDE += -I$(TARGET_ROOTDIR)/usr/share/ti/opencl
4 #DSP_INCLUDE += -I$(TI_OCL_INSTALL_DIR)/include
6 CPP   = g++
7 CL6X  = cl6x -mv6600 --abi=eabi $(DSP_INCLUDE)
8 CLOCL = clocl
10 LIBS  = -lOpenCL -locl_util #-lstdc++ -lrt 
12 UNAME_M :=$(shell uname -m)
14 OBJCOPY = arm-linux-gnueabihf-objcopy
16 ifneq (,$(findstring 86, $(UNAME_M)))
17     .DEFAULT_GOAL := cross
19     # In a cross compile environment we are assuming that the EVM file system
20     # is located on the build host and necessary ARM libraries are installed
21     # on that file system. 
22     ifneq ($(MAKECMDGOALS),clean)
23       ifneq ($(LIBOS),LIB_RTOS)
24         ifeq ($(TARGET_ROOTDIR),)
25           $(error Environment variable TARGET_ROOTDIR must be defined. Set it to point at the EVM root file system)
26         endif
27       endif
28           
29       ifeq ($(OMP_DIR),)
30         $(error Environment variable OMP_DIR must be defined. Set it to point at the OpenMP for DSP Installation Directory, or run the setup_hpc_env script available in the MCSDK-HPC installation)
31       endif
32     endif
34     # gcc ARM cross compiler will not, by default, search the host's
35     # /usr/include.  Explicitly specify here to find dependent vendor headers
36     cross: override CPP = arm-linux-gnueabihf-g++
37     cross: CPP_FLAGS += -I$(TARGET_ROOTDIR)/usr/include -idirafter /usr/include
38     #cross: CL6X_FLAGS += -I$(OMP_DIR)/packages/ti/runtime/openmp
40     # If cross-compilineg, provide path to dependent ARM libraries on the 
41     # target filesystem
42     cross: LD_FLAGS = -L$(TARGET_ROOTDIR)/lib -L$(TARGET_ROOTDIR)/usr/lib -Wl,-rpath-link,$(TARGET_ROOTDIR)/lib -Wl,-rpath-link,$(TARGET_ROOTDIR)/usr/lib 
43 endif
45 define FIND_DSP_PKG
46   export $(1)?=$$(patsubst %/$(3),%,$$(lastword $$(sort $$(wildcard $$(TI_SEARCH_PATH)/$(2)/$(3)))))
47   ifeq ($$($(1)),)
48     $$(error ERROR - $(1) is not defined and could not be found in $(TI_SEARCH_PATH)/ )
49   else
50     ifeq ($$(wildcard $$($(1))/$(3)),)
51       $$(error ERROR - "$(1) = $$($(1))" Is not valid!)
52     endif
53   endif
54   $$(info Using $(1) = $$($(1)))
55 endef
57 # CBLAS and BLIS directories
58 CBLAS_DSP_LIB = ../../cblas/lib/C66/libcblas_C66.ae66 
59 TICBLAS_DSP_LIB = ../../ticblas/lib/libticblas.ae66
60 CBLAS_ARM_LIB = ../../cblas/lib/ARM/libcblas_ARM.a
61 LIBARCH_LIB = $(LIBARCH_DIR)/lib/libArch.a66x
63 ifeq ($(MEM_MODEL),Large)
64 BLIS_DSP_LIB  = ../../blis/install/c66xLarge/lib/libblis.ae66
65 else ifeq ($(MEM_MODEL),Medium)
66 BLIS_DSP_LIB = ../../blis/install/c66xMedium/lib/libblis.ae66
67 else ifeq ($(MEM_MODEL),Small)
68 BLIS_DSP_LIB = ../../blis/install/c66xSmall/lib/libblis.ae66
69 #else ifeq ($(MEM_MODEL),Tiny)
70 endif
72 %.o: %.cpp
73         @echo Compiling $<
74         $(CPP) -c $(CPP_FLAGS) $<
76 %.o: %.c
77         @echo Compiling $<
78         $(CPP) -c $(CPP_FLAGS) $<
80 %.obj: %.c
81         @echo Compiling $<
82         $(CL6X) -c $(CL6X_FLAGS) $<
84 %.out: %.cl
85         @echo Compiling $< 
86         @$(CLOCL) $(CLOCL_FLAGS) $^
88 %.dsp_h: %.cl
89         @echo Compiling $< 
90         @$(CLOCL) -t $(CLOCL_FLAGS) $^
92 $(EXE):
94 cross: $(EXE)
96 clean::
97         @rm -f $(EXE) *.o *.obj *.out *.asm *.if *.opt *.bc *.objc *.map *.bin *.dsp_h
99 test: clean $(EXE)
100         @echo Running   $(EXE)
101         @./$(EXE) >> /dev/null
102         @if [ $$? -ne 0 ] ; then echo "FAILED !!!" ; fi