diff options
author | Roger Monk <r-monk@ti.com> | 2008-12-12 06:13:09 +0100 |
---|---|---|
committer | Koen Kooi <koen@openembedded.org> | 2008-12-12 06:13:09 +0100 |
commit | a687990e05975119fe41da5a23282c2182147bbc (patch) | |
tree | 602a0f149ce578f43d4b6e69096bfa5dd6f5aaa7 /packages/dsplink | |
parent | 08932f053357287239a6f0dc17d74981c107637c (diff) |
dsplink: fix user side build
Diffstat (limited to 'packages/dsplink')
-rw-r--r-- | packages/dsplink/dsplink.inc | 37 | ||||
-rw-r--r-- | packages/dsplink/dsplink_1.60.bb | 4 | ||||
-rwxr-xr-x | packages/dsplink/files/Makefile-dsplink-dsp | 59 | ||||
-rwxr-xr-x | packages/dsplink/files/Makefile-dsplink-gpp | 120 |
4 files changed, 203 insertions, 17 deletions
diff --git a/packages/dsplink/dsplink.inc b/packages/dsplink/dsplink.inc index 43b72c6137..00b62973ff 100644 --- a/packages/dsplink/dsplink.inc +++ b/packages/dsplink/dsplink.inc @@ -52,31 +52,38 @@ do_compile () { export ARCHIVER_AR=${TARGET_PREFIX}ar export BASE_SABIOS=${DSP_BASE_BIOS} - mkdir -p ${S}/dsplink-kbuild-test - cp ${WORKDIR}/Makefile-dsplink-kbuild ${S}/dsplink-kbuild-test/Makefile - cd ${S}/dsplink-kbuild-test/ + if [ ! -d ${S}/gpp/BUILD/EXPORT/RELEASE ] ; then + install -d ${S}/gpp/BUILD/EXPORT/RELEASE + fi + + cp ${WORKDIR}/Makefile-dsplink-gpp ${S}/gpp/BUILD/EXPORT/RELEASE/Makefile + cd ${S}/gpp/BUILD/EXPORT/RELEASE/ + unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS - oe_runmake KERNEL_PATH=${STAGING_KERNEL_DIR} \ - KERNEL_SRC=${STAGING_KERNEL_DIR} \ - KDIR=${STAGING_KERNEL_DIR} \ - KERNEL_VERSION=${KERNEL_VERSION} \ - CC="${KERNEL_CC}" LD="${KERNEL_LD}" \ - AR="${KERNEL_AR}" \ - V=1 ${MAKE_TARGETS} - make -e -f ${WORKDIR}/Makefile.dsplink +# oe_runmake KERNEL_PATH=${STAGING_KERNEL_DIR} \ +# KERNEL_SRC=${STAGING_KERNEL_DIR} \ +# KDIR=${STAGING_KERNEL_DIR} \ +# KERNEL_VERSION=${KERNEL_VERSION} \ +# CC="${KERNEL_CC}" LD="${KERNEL_LD}" \ +# AR="${KERNEL_AR}" \ +# V=1 ${MAKE_TARGETS} + + export KDIR=${STAGING_KERNEL_DIR} + make -e all + make -e -f ${WORKDIR}/Makefile-dsplink-dsp } do_install () { install -d ${D}/${bindir} # install ${S}/gpp/BUILD/EXPORT/RELEASE/loopgpp ${D}/${bindir} install ${S}/gpp/BUILD/EXPORT/RELEASE/messagegpp ${D}/${bindir} - install ${S}/gpp/BUILD/EXPORT/RELEASE/messagemultigpp ${D}/${bindir} +# install ${S}/gpp/BUILD/EXPORT/RELEASE/messagemultigpp ${D}/${bindir} install ${S}/gpp/BUILD/EXPORT/RELEASE/mpcsxfergpp ${D}/${bindir} - install ${S}/gpp/BUILD/EXPORT/RELEASE/mplistgpp ${D}/${bindir} +# install ${S}/gpp/BUILD/EXPORT/RELEASE/mplistgpp ${D}/${bindir} install ${S}/gpp/BUILD/EXPORT/RELEASE/readwritegpp ${D}/${bindir} - install ${S}/gpp/BUILD/EXPORT/RELEASE/ringiogpp ${D}/${bindir} +# install ${S}/gpp/BUILD/EXPORT/RELEASE/ringiogpp ${D}/${bindir} install ${S}/gpp/BUILD/EXPORT/RELEASE/scalegpp ${D}/${bindir} || true install -d ${D}/${datadir}/dsplink @@ -89,7 +96,7 @@ do_install () { } -# Coded Engine and friends need a complete tree, so stage it all +# Codec Engine and friends need a complete tree, so stage it all do_stage() { install -d ${STAGING_DIR}/${MULTIMACH_TARGET_SYS}/dsplink cp -pPr ${S}/* ${STAGING_DIR}/${MULTIMACH_TARGET_SYS}/dsplink/ diff --git a/packages/dsplink/dsplink_1.60.bb b/packages/dsplink/dsplink_1.60.bb index 61a79ad1ab..2f76ac1cb0 100644 --- a/packages/dsplink/dsplink_1.60.bb +++ b/packages/dsplink/dsplink_1.60.bb @@ -10,8 +10,8 @@ PV = "160" # Look for tarball at https://www-a.ti.com/downloads/sds_support/targetcontent/link/link_1_60/index.html SRC_URI = "http://install.tarball.in.source.dir/dsplink_1_60.tar.gz \ - file://Makefile.dsplink \ - file://Makefile-dsplink-kbuild \ + file://Makefile-dsplink-gpp \ + file://Makefile-dsplink-dsp \ " S = "${WORKDIR}/dsplink_1_60/dsplink" diff --git a/packages/dsplink/files/Makefile-dsplink-dsp b/packages/dsplink/files/Makefile-dsplink-dsp new file mode 100755 index 0000000000..0861f1ee21 --- /dev/null +++ b/packages/dsplink/files/Makefile-dsplink-dsp @@ -0,0 +1,59 @@ +# +# ======== makeunix ======== +# + +# Import Tools Path from Rules.make +#include Rules.make + +PROJECT_BASE_DIR = $(shell pwd) +LINUXKERNEL_INSTALL_DIR:=some-path/kernel +LINK_INSTALL_DIR := some-path/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:=some-path/cross + +# ---- DSP tools ---- +DSP_BASE_CGTOOLS := some-path/cg6x_6_0_19 +DSP_BASE_BIOS := some-path/bios_5_32_03 +DSP_BASE_RTDX := some-path/bios_5_32_03/packages/ti/rtdx +OSINC_PLATFORM1 := something +ARCHIVER_AR := something + + +# ---- 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) \ + +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/* diff --git a/packages/dsplink/files/Makefile-dsplink-gpp b/packages/dsplink/files/Makefile-dsplink-gpp new file mode 100755 index 0000000000..e69ce75f19 --- /dev/null +++ b/packages/dsplink/files/Makefile-dsplink-gpp @@ -0,0 +1,120 @@ +# Composite Makefile +DIRSEP=/ + +TI_DSPLINK_RELATIVE_PATH :=../../../../ + +# include the CURRENTCFG.mk +include $(DSPLINK)$(DIRSEP)config$(DIRSEP)BUILD$(DIRSEP)CURRENTCFG.MK + +# Generate the list of sources +SOURCES := +include $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)arch$(DIRSEP)SOURCES +ARCH_SOURCES := $(addprefix $(TI_DSPLINK_RELATIVE_PATH)gpp$(DIRSEP)src$(DIRSEP)arch$(DIRSEP),$(SOURCES)) +SOURCES := +include $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)ldrv$(DIRSEP)SOURCES +LDRV_SOURCES := $(addprefix $(TI_DSPLINK_RELATIVE_PATH)gpp$(DIRSEP)src$(DIRSEP)ldrv$(DIRSEP),$(SOURCES)) +SOURCES := +include $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)ldrv$(DIRSEP)$(TI_DSPLINK_GPPOS)$(DIRSEP)SOURCES +LDRV_SOURCES += $(addprefix $(TI_DSPLINK_RELATIVE_PATH)gpp$(DIRSEP)src$(DIRSEP)ldrv$(DIRSEP)$(TI_DSPLINK_GPPOS)$(DIRSEP),$(SOURCES)) +SOURCES := +include $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)gen$(DIRSEP)SOURCES +GEN_SOURCES := $(addprefix $(TI_DSPLINK_RELATIVE_PATH)gpp$(DIRSEP)src$(DIRSEP)gen$(DIRSEP),$(SOURCES)) +SOURCES := +include $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)pmgr$(DIRSEP)SOURCES +PMGR_SOURCES := $(addprefix $(TI_DSPLINK_RELATIVE_PATH)gpp$(DIRSEP)src$(DIRSEP)pmgr$(DIRSEP),$(SOURCES)) +SOURCES := +include $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)pmgr$(DIRSEP)$(TI_DSPLINK_GPPOS)$(DIRSEP)SOURCES +PMGR_SOURCES += $(addpreifx $(TI_DSPLINK_RELATIVE_PATH)gpp$(DIRSEP)src$(DIRSEP)pmgr$(DIRSEP)$(TI_DSPLINK_GPPOS)$(DIRSEP),$(SOURCES)) +SOURCES := +include $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)pmgr$(DIRSEP)$(TI_DSPLINK_GPPOS)$(DIRSEP)$(TI_DSPLINK_GPPOSVERSION)$(DIRSEP)SOURCES +PMGR_SOURCES += $(addprefix $(TI_DSPLINK_RELATIVE_PATH)gpp$(DIRSEP)src$(DIRSEP)pmgr$(DIRSEP)$(TI_DSPLINK_GPPOS)$(DIRSEP)$(TI_DSPLINK_GPPOSVERSION)$(DIRSEP),$(SOURCES)) +SOURCES := +include $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)osal$(DIRSEP)$(DIRSEP)SOURCES +OSAL_SOURCES := $(addprefix $(TI_DSPLINK_RELATIVE_PATH)gpp$(DIRSEP)src$(DIRSEP)osal$(DIRSEP)$(DIRSEP),$(SOURCES)) +SOURCES := +include $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)osal$(DIRSEP)$(TI_DSPLINK_GPPOS)$(DIRSEP)SOURCES +OSAL_SOURCES += $(addprefix $(TI_DSPLINK_RELATIVE_PATH)gpp$(DIRSEP)src$(DIRSEP)osal$(DIRSEP)$(TI_DSPLINK_GPPOS)$(DIRSEP),$(SOURCES)) +SOURCES := +include $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)osal$(DIRSEP)$(TI_DSPLINK_GPPOS)$(DIRSEP)$(TI_DSPLINK_GPPOSVERSION)$(DIRSEP)SOURCES +OSAL_SOURCES += $(addprefix $(TI_DSPLINK_RELATIVE_PATH)gpp$(DIRSEP)src$(DIRSEP)osal$(DIRSEP)$(TI_DSPLINK_GPPOS)$(DIRSEP)$(TI_DSPLINK_GPPOSVERSION)$(DIRSEP),$(SOURCES)) + +DSPLINK_SOURCES := $(ARCH_SOURCES) $(LDRV_SOURCES) $(GEN_SOURCES) $(OSAL_SOURCES) $(PMGR_SOURCES) +DSPLINK_OBJS := $(foreach srcFile, $(DSPLINK_SOURCES),$(basename $(srcFile)).o) + +# EXTRA_CFLAGS +EXTRA_CFLAGS += $(addprefix -D, $(TI_DSPLINK_GPP_DEFINES)) +EXTRA_CFLAGS += $(addprefix -I, $(TI_DSPLINK_GPP_INC_PATH)) +EXTRA_CFLAGS += -DEXPORT_SYMTAB +EXTRA_CFLAGS += -DTRACE_KERNEL + +ifneq ($(KERNELRELEASE),) +obj-m := dsplinkk.o +dsplinkk-objs := $(DSPLINK_OBJS) +else +KDIR := /path/to/kernel/ +PWD := $(shell pwd) +driver: + $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules +endif + +clean: + @echo DSPLINK - cleaning driver, library and samples + find $(DSPLINK) -name "*.o" -exec rm {} \; + rm -fr dsplinkk.ko dsplinkk.mod.c Module.symvers *gpp *.a *.lib + +################################################################################################ +# USER SIDE +BUILD_CONFIG := ..$(DIRSEP)..$(DIRSEP)..$(DIRSEP)config$(DIRSEP)BUILD +# Generate the list of sources +SOURCES := +include $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)api$(DIRSEP)SOURCES +API_SOURCES := $(addprefix $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)api$(DIRSEP),$(SOURCES)) +SOURCES := +include $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)api$(DIRSEP)$(TI_DSPLINK_GPPOS)$(DIRSEP)SOURCES +API_SOURCES += $(addprefix $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)api$(DIRSEP)$(TI_DSPLINK_GPPOS)$(DIRSEP),$(SOURCES)) + +# Update the CFLAG +#CC = arm-none-linux-gnueabi-gcc +#AR = arm-none-linux-gnueabi-ar +#LD = arm-none-linux-gnueabi-ld +ARFLAGS = -rs +LDFLAGS = -r +EXTRA_CFLAGS += $(addprefix -D, $(TI_DSPLINK_GPP_DEFINES)) $(addprefix -I, $(TI_DSPLINK_GPP_INC_PATH)) + +define CONFIG_template +$(shell cp $(DSPLINK)$(DIRSEP)config$(DIRSEP)all$(DIRSEP)$(1) $(DSPLINK)$(DIRSEP)config$(DIRSEP)BUILD$(DIRSEP)) +endef + +define PROGRAM_template +$(basename $(1)).o: $(1) + $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c $(1) -o $(basename $(1)).o +endef +$(foreach prog,$(API_SOURCES),$(eval $(call PROGRAM_template,$(prog)))) +$(foreach prog,$(CONFIG),$(eval $(call CONFIG_template,$(prog)))) + +DSPLINK_API_OBJS := $(foreach srcFile, $(API_SOURCES),$(basename $(srcFile)).o) + +library: $(DSPLINK_API_OBJS) + @echo DSPLINK - building user library - dsplink.lib + $(LD) $(LDFLAGS) -o dsplink.lib $(DSPLINK_API_OBJS) + $(AR) $(ARFLAGS) dsplink.a $(DSPLINK_API_OBJS) + + +######################################### SAMPLES ################################### +SOURCES := +define SAMPLES_template +ifneq ($(1),message_multi) +$(1): $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)samples$(DIRSEP)$(1)$(DIRSEP)$(1).c $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)samples$(DIRSEP)$(1)$(DIRSEP)$(TI_DSPLINK_GPPOS)$(DIRSEP)$(1)_os.c + $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -I$(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)samples$(DIRSEP)$(1) -I$(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)samples$(DIRSEP)$(1)$(DIRSEP)$(TI_DSPLINK_GPPOS) -o $(1)gpp $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)samples$(DIRSEP)$(1)$(DIRSEP)$(1).c $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)samples$(DIRSEP)$(1)$(DIRSEP)$(TI_DSPLINK_GPPOS)$(DIRSEP)$(1)_os.c $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)samples$(DIRSEP)$(1)$(DIRSEP)$(TI_DSPLINK_GPPOS)$(DIRSEP)main.c dsplink.lib -lpthread +else +$(1): $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)samples$(DIRSEP)$(1)$(DIRSEP)message.c $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)samples$(DIRSEP)$(1)$(DIRSEP)$(TI_DSPLINK_GPPOS)$(DIRSEP)message_os.c + $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -I$(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)samples$(DIRSEP)$(1) -I$(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)samples$(DIRSEP)$(1)$(DIRSEP)$(TI_DSPLINK_GPPOS) -o $(1)gpp $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)samples$(DIRSEP)$(1)$(DIRSEP)message.c $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)samples$(DIRSEP)$(1)$(DIRSEP)$(TI_DSPLINK_GPPOS)$(DIRSEP)message_os.c $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)samples$(DIRSEP)$(1)$(DIRSEP)$(TI_DSPLINK_GPPOS)$(DIRSEP)main.c dsplink.lib -lpthread +endif +endef + +include $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)samples$(DIRSEP)DIRS +$(foreach prog,$(DIRS),$(eval $(call SAMPLES_template,$(prog)))) + +samples: $(foreach prog,$(DIRS),$(prog)) + +all: driver library samples |