]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blob - psdk_cust/libarch_k2g_1_0_1_0/packages/ti/libarch/make.inc
PASDK-258:Merge remote-tracking branch 'origin/dev_pasdk_pp_pasdk242HigherSamplingRat...
[processor-sdk/performance-audio-sr.git] / psdk_cust / libarch_k2g_1_0_1_0 / packages / ti / libarch / make.inc
1 DSP_INCLUDE  = -I$(TARGET_ROOTDIR)/usr/share/ti/cgt-c6x/include
2 DSP_INCLUDE += -I$(TARGET_ROOTDIR)/usr/share/ti/opencl
4 CPP   = g++
5 CL6X  = cl6x -mv6600 --abi=eabi $(DSP_INCLUDE)
6 CLOCL = clocl
8 LIBS  = -lOpenCL -locl_util #-lstdc++ -lrt 
10 UNAME_M :=$(shell uname -m)
12 OBJCOPY = $(TARGET_ROOTDIR)/usr/bin/arm-linux-gnueabihf-objcopy
14 ifneq (,$(findstring 86, $(UNAME_M)))
15     .DEFAULT_GOAL := cross
16     OBJCOPY = $(TOOLCHAIN_DIR)/arm-linux-gnueabihf/bin/objcopy
18     # In a cross compile environment we are assuming that the EVM file system
19     # is located on the build host and necessary ARM libraries are installed
20     # on that file system. 
21     ifneq ($(MAKECMDGOALS),clean)
22        ifeq ($(TARGET_ROOTDIR),)
23          $(error Environment variable TARGET_ROOTDIR must be defined. Set it to point at the EVM root file system)
24        endif
25        ifeq ($(OMP_DIR),)
26          $(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)
27        endif
28     endif
30     # gcc ARM cross compiler will not, by default, search the host's
31     # /usr/include.  Explicitly specify here to find dependent vendor headers
32     cross: override CPP = arm-linux-gnueabihf-g++
33     cross: CPP_FLAGS += -I$(TARGET_ROOTDIR)/usr/include -idirafter /usr/include
34     #cross: CL6X_FLAGS += -I$(OMP_DIR)/packages/ti/runtime/openmp
36     # If cross-compilineg, provide path to dependent ARM libraries on the 
37     # target filesystem
38     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 
39 endif
41 define FIND_DSP_PKG
42   export $(1)?=$$(patsubst %/$(3),%,$$(lastword $$(sort $$(wildcard $$(TI_INSTALL_DIR)/$(2)/$(3)))))
43   ifeq ($$($(1)),)
44     $$(error ERROR - $(1) is not defined and could not be found in $(TI_INSTALL_DIR)/ )
45   else
46     ifeq ($$(wildcard $$($(1))/$(3)),)
47       $$(error ERROR - "$(1) = $$($(1))" Is not valid!)
48     endif
49   endif
50   $$(info Using $(1) = $$($(1)))
51 endef
53 ifeq ($(TARGET_OS), TI_RTOS)
54   $(eval $(call FIND_DSP_PKG,PDK_DIR,pdk_C6678*,packages))
55   DSP_INCLUDE += -I$(PDK_DIR)/packages
56 endif
58 %.o: %.cpp
59         @echo Compiling $<
60         $(CPP) -c $(CPP_FLAGS) $<
62 %.o: %.c
63         @echo Compiling $<
64         $(CPP) -c $(CPP_FLAGS) $<
66 %.obj: %.c
67         @echo Compiling $<
68         $(CL6X) -c $(CL6X_FLAGS) $<
70 %.out: %.cl
71         @echo Compiling $< 
72         @$(CLOCL) $(CLOCL_FLAGS) $^
74 %.dsp_h: %.cl
75         @echo Compiling $< 
76         @$(CLOCL) -t $(CLOCL_FLAGS) $^
78 $(EXE):
80 cross: $(EXE)
82 clean::
83         @rm -f $(EXE) *.o *.obj *.out *.asm *.if *.opt *.bc *.objc *.map *.bin *.dsp_h
85 test: clean $(EXE)
86         @echo Running   $(EXE)
87         @./$(EXE) >> /dev/null
88         @if [ $$? -ne 0 ] ; then echo "FAILED !!!" ; fi