]> 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/examples/arm+dsp/Makefile
PASDK-258:Add LibArch release from Jianzhong
[processor-sdk/performance-audio-sr.git] / psdk_cust / libarch_k2g_1_0_1_0 / examples / arm+dsp / Makefile
2 # Defines
3 TEST_FAT_BINARY = 1
5 INCDIR := $(XDC_DIR)/packages;$(BIOS_DIR)/packages;$(XDAIS_DIR)/packages;$(CGTROOT)/include;$(PDK_DIR)/packages;$(FC_DIR)/packages;$(TI_OCL_INSTALL_DIR);$(OMP_DIR)/packages/ti/runtime/openmp;$(LIBARCH_DIR)/packages
7 INCS = -I. -I$(strip $(subst ;, -I,$(subst $(space),$(space),$(INCDIR))))
8 OBJS = test_app_arm.o test_lib_arm.o
10 LD_FLAGS=-L$(TARGET_ROOTDIR)/lib -L$(TARGET_ROOTDIR)/usr/lib -Wl,-rpath-link,$(TARGET_ROOTDIR)/lib -Wl,-rpath-link,$(TARGET_ROOTDIR)/usr/lib
12 CL6X  = cl6x -mv6600 --abi=eabi
13 CPP = arm-linux-gnueabihf-g++
14 LINK_FLAGS = -lOpenCL -locl_util -lstdc++ -lrt -lm -lgomp -lpthread -ldl
15 CPP_DEBUG   = -g
16 CPP_FLAGS   = -D_LITTLE_ENDIAN -D__ARMv7 -I$(TARGET_ROOTDIR)/usr/include
17 CL6X_FLAGS  = $(INCS) --openmp --use_g2 -D$(TARGET) -D$(LIBOS)
18 ARM_PLUS_DSP_EXE= libarch_test
20 LIBFW_LIB = $(LIBARCH_DIR)/packages/ti/libarch/lib/libarch.ae66
21 OCL_BIN = test_lib_ocl.out
23 ifeq ($(TEST_FAT_BINARY), 1)
24   CPP_FLAGS += -DTEST_FAT_BINARY
25   OCL_BIN = test_lib_ocl.dsp_h
26 endif
28 all: libarch_test
29 cross: libarch_test
31 $(ARM_PLUS_DSP_EXE): $(OCL_BIN) $(OBJS)
32         @echo; echo "Building hybrid ARM+DSP executable: $(ARM_PLUS_DSP_EXE)"
33         $(CPP) $(CPPFLAGS) $(LD_FLAGS) $(OBJS) $(LINK_FLAGS) -o $@
35 # if we have a fat binary header then the initfini file needs it
36 test_app_arm.o: test_app_arm.cpp
37         @echo Compiling $<
38         $(CPP) -c $(CPP_FLAGS) $<
40 test_lib_arm.o: test_lib_arm.cpp
41         @echo Compiling $<
42         $(CPP) -c $(CPP_FLAGS) $<
44 # target for fat binary
45 test_lib_ocl.dsp_h: test_lib_dsp.obj test_lib_ocl.cl test_dsp_kernel.obj
46         @echo; echo Building $@
47         @rm -f test_lib_ocl.out
48         @echo Building fat binary header
49         clocl --txt -g $^ $(LIBFW_LIB)
51 # target if fat binary not used
52 test_lib_ocl.out: test_lib_dsp.obj test_lib_ocl.cl test_dsp_kernel.obj
53         @echo; echo Building $@
54         clocl $^ 
56 test_dsp_kernel.obj: ../common/test_dsp_kernel.c
57         $(CL6X) -c $(CL6X_FLAGS) $<
59 test_lib_dsp.obj: ./test_lib_dsp.c
60         $(CL6X) -c $(CL6X_FLAGS) $<
62 clean:
63         @rm -f $(OBJS) $(OCL_BIN) *.obj *.out
64         @rm -f $(ARM_PLUS_DSP_EXE)
66 %.obj: %.c
67         @echo Compiling $<
68         $(CL6X) -c $(CL6X_FLAGS) $<