]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - dense-linear-algebra-libraries/linalg.git/blob - make.inc
Added release notes in docs folder.
[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 = $(TARGET_ROOTDIR)/usr/bin/arm-linux-gnueabihf-objcopy
16 ifneq (,$(findstring 86, $(UNAME_M)))
17     .DEFAULT_GOAL := cross
18     OBJCOPY = $(TOOLCHAIN_DIR)/arm-linux-gnueabihf/bin/objcopy
20     # In a cross compile environment we are assuming that the EVM file system
21     # is located on the build host and necessary ARM libraries are installed
22     # on that file system. 
23     ifneq ($(MAKECMDGOALS),clean)
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        ifeq ($(OMP_DIR),)
28          $(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)
29        endif
30     endif
32     # gcc ARM cross compiler will not, by default, search the host's
33     # /usr/include.  Explicitly specify here to find dependent vendor headers
34     cross: override CPP = arm-linux-gnueabihf-g++
35     cross: CPP_FLAGS += -I$(TARGET_ROOTDIR)/usr/include -idirafter /usr/include
36     #cross: CL6X_FLAGS += -I$(OMP_DIR)/packages/ti/runtime/openmp
38     # If cross-compilineg, provide path to dependent ARM libraries on the 
39     # target filesystem
40     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 
41 endif
43 define FIND_DSP_PKG
44   export $(1)?=$$(patsubst %/$(3),%,$$(lastword $$(sort $$(wildcard $$(TI_SEARCH_PATH)/$(2)/$(3)))))
45   ifeq ($$($(1)),)
46     $$(error ERROR - $(1) is not defined and could not be found in $(TI_SEARCH_PATH)/ )
47   else
48     ifeq ($$(wildcard $$($(1))/$(3)),)
49       $$(error ERROR - "$(1) = $$($(1))" Is not valid!)
50     endif
51   endif
52   $$(info Using $(1) = $$($(1)))
53 endef
55 %.o: %.cpp
56         @echo Compiling $<
57         $(CPP) -c $(CPP_FLAGS) $<
59 %.o: %.c
60         @echo Compiling $<
61         $(CPP) -c $(CPP_FLAGS) $<
63 %.obj: %.c
64         @echo Compiling $<
65         $(CL6X) -c $(CL6X_FLAGS) $<
67 %.out: %.cl
68         @echo Compiling $< 
69         @$(CLOCL) $(CLOCL_FLAGS) $^
71 %.dsp_h: %.cl
72         @echo Compiling $< 
73         @$(CLOCL) -t $(CLOCL_FLAGS) $^
75 $(EXE):
77 cross: $(EXE)
79 clean::
80         @rm -f $(EXE) *.o *.obj *.out *.asm *.if *.opt *.bc *.objc *.map *.bin *.dsp_h
82 test: clean $(EXE)
83         @echo Running   $(EXE)
84         @./$(EXE) >> /dev/null
85         @if [ $$? -ne 0 ] ; then echo "FAILED !!!" ; fi