aboutsummaryrefslogtreecommitdiffstats
path: root/packages/dsplink/files/Makefile.dsplink
blob: 7156bcbda3dbd768a6f2a7faae5a23c0e28471a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#
#  ======== makeunix ========
#

# Import Tools Path from Rules.make
#include Rules.make

PROJECT_BASE_DIR = $(shell pwd)
LINUXKERNEL_INSTALL_DIR:=/home/rmonklocal/oe/angstrom-davinci-dvevm-tmp/staging/davinci-dvevm-angstrom-linux-gnueabi/kernel
LINK_INSTALL_DIR := /home/rmonklocal/dsplink_1_51/dsplink

# The prefix to be added before the GNU compiler tools (optionally including
# path), i.e. "arm_v5t_le-" or "/opt/bin/arm_v5t_le-".
GPPTOOL_DIR:=/home/rmonklocal/oe/angstrom-davinci-dvevm-tmp/cross

# ---- DSP tools ----
DSP_BASE_CGTOOLS    := /home/rmonklocal/opt/cg6x_6_0_19
DSP_BASE_BIOS	    := /home/rmonklocal/opt/bios_5_32_03
DSP_BASE_RTDX	    := /home/rmonklocal/opt/bios_5_32_03/packages/ti/rtdx
OSINC_PLATFORM1     := something
ARCHIVER_AR         := something

# ---- get build host OS ----
UNAME=$(shell uname)
ifeq "$(UNAME)" "Linux"
	BUILD_HOST_OS=Linux
else
	BUILD_HOST_OS=Solaris
endif

# ---- construct Link build make vars ----
GPP_MAKE_OPTS :=  COMPILER=$(GPPTOOL_DIR)/bin/arm-angstrom-linux-gnueabi-gcc \
		  LINKER=$(GPPTOOL_DIR)/bin/arm-angstrom-linux-gnueabi-gcc \
		  LD=$(GPPTOOL_DIR)/bin/arm-angstrom-linux-gnueabi-ld \
		  ARCHIVER1=$(GPPTOOL_DIR)/bin/arm-angstrom-linux-gnueabi-ld \
		  ARCHIVER2=$(GPPTOOL_DIR)/bin/arm-angstrom-linux-gnueabi-ld \
		  CROSS_COMPILE=arm-angstrom-linux-gnueabi- \
		  DSPLINK=$(LINK_INSTALL_DIR) \
		  BASE_TOOLCHAIN=$(GPPTOOL_DIR) \
		  BASE_BUILDOS=$(LINUXKERNEL_INSTALL_DIR) \
		  ARCHIVER=$(ARCHIVER_AR) OSINC_PLATFORM=$(OSINC_PLATFORM1) \
		  #STD_KRNL_FLAGS=\
		   -include linux/autoconf.h -c -iwithprefix include -Iinclude -Wall  -Wstrict-prototypes \
                   -Wno-trigraphs -fno-strict-aliasing -fno-common             \
                   -fno-omit-frame-pointer -mapcs -mno-sched-prolog            \
                   -mlittle-endian \
                   -D__LINUX_ARM_ARCH__=5 -march=armv5t -mtune=arm9tdmi \
                   -msoft-float -Uarm -mapcs                  \
                   -Wdeclaration-after-statement -Os -marm  -mabi=aapcs-linux

		  #STD_KRNL_FLAGS=\
			-nostdinc \
			-isystem /home/rmonklocal/oe/angstrom-davinci-dvevm-tmp/cross/lib/gcc/arm-angstrom-linux-gnueabi/4.2.4/include \
			-D__KERNEL__ \
			-Iinclude -include include/linux/autoconf.h \
			-mlittle-endian \
			-Wall \
			-Wundef \
			-Wstrict-prototypes \
			-Wno-trigraphs \
			-fno-strict-aliasing \
			-fno-common \
			-Werror-implicit-function-declaration \
			-Os \
			-fno-stack-protector \
			-marm \
			-fno-omit-frame-pointer \
			-mapcs \
			-mno-sched-prolog \
			-mabi=aapcs-linux \
			-mno-thumb-interwork \
			-D__LINUX_ARM_ARCH__=5 \
			-march=armv5te \
			-mtune=arm9tdmi \
			-msoft-float \
			-Uarm \
			-fno-omit-frame-pointer \
			-fno-optimize-sibling-calls \
			-Wdeclaration-after-statement \
			-Wno-pointer-sign \
			-c

DSP_MAKE_OPTS :=  DSPLINK=$(DSPLINK) \
                  DPPROOT=$(DSPLINK)/dsp \
                  BASE_SABIOS=$(DSP_BASE_BIOS) \
                  BASE_CGTOOLS=$(DSP_BASE_CGTOOLS) \
                  BASE_RTDX=$(DSP_BASE_RTDX)
                  

#  ======== all ========
all: $(LINK_INSTALL_DIR)/packages/dsplink/gpp/export/BIN/Linux/Davinci/RELEASE/dsplinkk.ko

$(LINK_INSTALL_DIR)/packages/dsplink/gpp/export/BIN/Linux/Davinci/RELEASE/dsplinkk.ko:
	@echo Building DSPLINK GPP driver, libs
	make -s -C $(LINK_INSTALL_DIR)/gpp/src $(GPP_MAKE_OPTS) 
	make -s -C $(DSPLINK)/gpp/src/samples $(GPP_MAKE_OPTS) 
	@echo Building DSPLINK DSP libs and message sample for DaVinci...
	make -C $(DSPLINK)/dsp/src $(DSP_MAKE_OPTS) 
	make -C $(DSPLINK)/dsp/src/samples $(DSP_MAKE_OPTS) 

#  clean rules
clean:
	@echo Cleaning DSPLINK GPP driver, libs
	make -s -C $(LINK_INSTALL_DIR)/gpp/src $(GPP_MAKE_OPTS) clean
	@rm -rf $(LINK_INSTALL_DIR)/gpp/export/BIN/*
	@rm -rf $(LINK_INSTALL_DIR)/gpp/export/INCLUDE/*