summaryrefslogtreecommitdiff
path: root/recipes/dsplink/files/Makefile-dsplink-gpp
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/dsplink/files/Makefile-dsplink-gpp
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/dsplink/files/Makefile-dsplink-gpp')
-rwxr-xr-xrecipes/dsplink/files/Makefile-dsplink-gpp120
1 files changed, 120 insertions, 0 deletions
diff --git a/recipes/dsplink/files/Makefile-dsplink-gpp b/recipes/dsplink/files/Makefile-dsplink-gpp
new file mode 100755
index 0000000000..d9f2f6209a
--- /dev/null
+++ b/recipes/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)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