dsplink: add a dsplink-module recipe that uses Kbuild to build a kernel module
authorKoen Kooi <koen@openembedded.org>
Wed, 19 Nov 2008 13:41:01 +0000 (14:41 +0100)
committerKoen Kooi <koen@openembedded.org>
Wed, 19 Nov 2008 13:41:01 +0000 (14:41 +0100)
* also start transitioning monolithis recipe to build kernel parts as seperate recipes

packages/dsplink/codec-engine_2.21.bb
packages/dsplink/dsplink-module_1.60.bb [new file with mode: 0644]
packages/dsplink/dsplink.inc
packages/dsplink/dsplink_1.60.bb
packages/dsplink/files/Makefile-dsplink-kbuild [new file with mode: 0644]

index 7c81704..a77bb95 100644 (file)
@@ -19,6 +19,7 @@ PV = "221"
 
 SRC_URI = "http://install.tarball.in.source.dir/codec_engine_2_21.tar.gz \
            file://Makefile.dsplink \
+           file://Makefile-dsplink-kbuild \
 "
 
 S = "${WORKDIR}/codec_engine_2_21"
diff --git a/packages/dsplink/dsplink-module_1.60.bb b/packages/dsplink/dsplink-module_1.60.bb
new file mode 100644 (file)
index 0000000..e2a8ef3
--- /dev/null
@@ -0,0 +1,43 @@
+# The tconf tool breaks if there is a '.' in your pwd
+PR = "r2"
+PE = "1"
+PV = "160"
+
+# Get dsplink tarball from TI website, place in sources and calculate
+# md5sum
+# 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 \
+"
+
+S = "${WORKDIR}/dsplink_1_60/dsplink"
+
+# Needed for buildscripts
+export DSPLINK="${S}"
+
+inherit module
+require ti-paths.inc
+
+do_configure() {
+    # Run perl script to create appropriate makefiles (v1.60 and up)
+    perl config/bin/dsplinkcfg.pl --platform=${DSPLINKPLATFORM} --nodsp=1 --dspcfg_0=${DSPCFG} --dspos_0=DSPBIOS5XX  --gppos=${GPPOS} --comps=ponslrm
+    
+       mkdir -p ${S}/dsplink-kbuild-test
+    cp ${WORKDIR}/Makefile-dsplink-kbuild  ${S}/dsplink-kbuild-test/Makefile
+}
+
+do_compile_prepend() {
+       cd ${S}/dsplink-kbuild-test/
+}
+
+do_install() {
+    install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp
+    cp ${S}/dsplink-kbuild-test/dsplinkk.ko ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp/
+}
+
+INHIBIT_PACKAGE_STRIP = "1"
+
+
+
index 30d1ca3..1f72d24 100644 (file)
@@ -1,6 +1,6 @@
 DESCRIPTION = "DSP Link for TI ARM/DSP processors"
 
-DEPENDS = "virtual/kernel perl-native"
+DEPENDS = "virtual/kernel dsplink-module perl-native"
 RDEPENDS_${PN}-module = "update-modules"
 RRECOMMENDS_${PN} = "${PN}-module"
 
@@ -48,9 +48,6 @@ do_compile () {
 }
 
 do_install () {
-       install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp
-       cp ${S}/gpp/BUILD/EXPORT/RELEASE/dsplinkk.ko ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp/
-
        install -d ${D}/${bindir}
 #      install ${S}/gpp/BUILD/EXPORT/RELEASE/loopgpp           ${D}/${bindir}
        install ${S}/gpp/BUILD/EXPORT/RELEASE/messagegpp        ${D}/${bindir}
index 1202777..6c7da5b 100644 (file)
@@ -11,6 +11,7 @@ PV = "160"
 
 SRC_URI = "http://install.tarball.in.source.dir/dsplink_1_60.tar.gz \
                file://Makefile.dsplink \
+               file://Makefile-dsplink-kbuild \
 "
 
 S = "${WORKDIR}/dsplink_1_60/dsplink"
diff --git a/packages/dsplink/files/Makefile-dsplink-kbuild b/packages/dsplink/files/Makefile-dsplink-kbuild
new file mode 100644 (file)
index 0000000..0fdf896
--- /dev/null
@@ -0,0 +1,74 @@
+# 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)
+
+################################################################################################
+# USER SIDE
+# Generate the list of sources
+SOURCES :=
+include $(TI_DSPLINK_GPPROOT)$(DIRSEP)src$(DIRSEP)api$(DIRSEP)SOURCES
+API_SOURCES := $(addprefix $(TI_DSPLINK_RELATIVE_PATH)gpp$(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_RELATIVE_PATH)gpp$(DIRSEP)src$(DIRSEP)api$(DIRSEP)$(TI_DSPLINK_GPPOS)$(DIRSEP),$(SOURCES))
+
+# 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
+libs-m  := $(shell pwd)
+lib-m   := $(foreach srcFile, $(API_SOURCES),$(basename $(srcFile)).o)
+dsplinkk-objs := $(DSPLINK_OBJS)
+else
+KDIR    := /opt/montavista/pro/devkit/lsp/ti-davinci/linux-2.6.18_pro500
+PWD    := $(shell pwd) 
+all:
+       $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
+endif
+
+clean:
+       find $(DSPLINK) -name "*.o" -exec rm {} \;
+       rm -fr dsplinkk.ko  dsplinkk.mod.c Module.symvers