From f65299e8b2e6ffb0b07089759f8c4ff33a695c09 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Thu, 4 Apr 2013 14:39:15 -0500 Subject: [PATCH] oct612x: Break the oct612x out into a separate library. Soon there will be more than one driver in the source tree that will want to use these files. Compiling it as a library speeds the build since it won't have to be built for each driver that wants to link it in. Signed-off-by: Shaun Ruffell Signed-off-by: Russ Meyerriecks --- Makefile | 6 +++- drivers/dahdi/oct612x/Makefile | 66 +++++++++++++++------------------- drivers/dahdi/wct4xxp/Kbuild | 2 +- 3 files changed, 35 insertions(+), 39 deletions(-) diff --git a/Makefile b/Makefile index 73a30b5..0b90ea9 100644 --- a/Makefile +++ b/Makefile @@ -86,7 +86,7 @@ include/dahdi/version.h: FORCE fi @rm -f $@.tmp -prereq: include/dahdi/version.h firmware-loaders +prereq: include/dahdi/version.h firmware-loaders oct612x-lib stackcheck: $(CHECKSTACK) modules objdump -d drivers/dahdi/*.ko drivers/dahdi/*/*.ko | $(CHECKSTACK) @@ -122,6 +122,9 @@ uninstall-firmware: firmware-loaders: $(MAKE) -C drivers/dahdi/firmware firmware-loaders +oct612x-lib: + $(MAKE) -C $(KSRC) M='$(PWD)/drivers/dahdi/oct612x' + install-include: for hdr in $(INST_HEADERS); do \ install -D -m 644 include/dahdi/$$hdr $(DESTDIR)/usr/include/dahdi/$$hdr; \ @@ -189,6 +192,7 @@ ifneq (no,$(HAS_KSRC)) endif @rm -f $(GENERATED_DOCS) $(MAKE) -C drivers/dahdi/firmware clean + $(MAKE) -C $(KSRC) M='$(PWD)/drivers/dahdi/oct612x' clean distclean: dist-clean diff --git a/drivers/dahdi/oct612x/Makefile b/drivers/dahdi/oct612x/Makefile index e3e32e5..5d29143 100644 --- a/drivers/dahdi/oct612x/Makefile +++ b/drivers/dahdi/oct612x/Makefile @@ -1,38 +1,30 @@ -CFLAGS=-V3.4 -ffunction-sections -I/lib/modules/$(shell uname -r)/build/include -Iinclude -Ioctdeviceapi -Ioctdeviceapi/oct6100api -DGFP_ATOMIC=0 -Dkmalloc=calloc -Dkfree=free -LDFLAGS=-V3.4 -Wl,-Map -Wl,test.map -Wl,--gc-sections +# +# Produces the oct612x library +# +octapi_files = octdeviceapi/oct6100api/oct6100_api/oct6100_adpcm_chan.o \ + octdeviceapi/oct6100api/oct6100_api/oct6100_channel.o \ + octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.o \ + octdeviceapi/oct6100api/oct6100_api/oct6100_chip_stats.o \ + octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.o \ + octdeviceapi/oct6100api/oct6100_api/oct6100_debug.o \ + octdeviceapi/oct6100api/oct6100_api/oct6100_events.o \ + octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.o \ + octdeviceapi/oct6100api/oct6100_api/oct6100_memory.o \ + octdeviceapi/oct6100api/oct6100_api/oct6100_miscellaneous.o \ + octdeviceapi/oct6100api/oct6100_api/oct6100_mixer.o \ + octdeviceapi/oct6100api/oct6100_api/oct6100_phasing_tsst.o \ + octdeviceapi/oct6100api/oct6100_api/oct6100_playout_buf.o \ + octdeviceapi/oct6100api/oct6100_api/oct6100_remote_debug.o \ + octdeviceapi/oct6100api/oct6100_api/oct6100_tlv.o \ + octdeviceapi/oct6100api/oct6100_api/oct6100_tone_detection.o \ + octdeviceapi/oct6100api/oct6100_api/oct6100_tsi_cnct.o \ + octdeviceapi/oct6100api/oct6100_api/oct6100_tsst.o \ + apilib/bt/octapi_bt0.o \ + apilib/largmath/octapi_largmath.o \ + apilib/llman/octapi_llman.o -APIDIR=octdeviceapi/oct6100api/oct6100_api - -OCTASIC_OBJS=$(APIDIR)/oct6100_adpcm_chan.o \ - $(APIDIR)/oct6100_channel.o \ - $(APIDIR)/oct6100_chip_open.o \ - $(APIDIR)/oct6100_chip_stats.o \ - $(APIDIR)/oct6100_conf_bridge.o \ - $(APIDIR)/oct6100_debug.o \ - $(APIDIR)/oct6100_events.o \ - $(APIDIR)/oct6100_interrupts.o \ - $(APIDIR)/oct6100_memory.o \ - $(APIDIR)/oct6100_miscellaneous.o \ - $(APIDIR)/oct6100_mixer.o \ - $(APIDIR)/oct6100_phasing_tsst.o \ - $(APIDIR)/oct6100_playout_buf.o \ - $(APIDIR)/oct6100_remote_debug.o \ - $(APIDIR)/oct6100_tlv.o \ - $(APIDIR)/oct6100_tone_detection.o \ - $(APIDIR)/oct6100_tsi_cnct.o \ - $(APIDIR)/oct6100_tsst.o \ - $(APIDIR)/oct6100_user.o \ - apilib/bt/octapi_bt0.o \ - apilib/largmath/octapi_largmath.o \ - apilib/llman/octapi_llman.o - - -all: test - -test.o: test.c - -test: test.o $(OCTASIC_OBJS) - -clean: - rm -rf test test.o - rm -rf $(OCTASIC_OBJS) +# TODO: ccflags was added in 2.6.24 in commit f77bf01425b11947eeb3b5b54. This +# should be changed to a conditional compilation based on the Kernel Version. +# ccflags-y := -I$(src)/.. -Wno-undef -I$(src)/include -I$(src)/octdeviceapi -I$(src)/octdeviceapi/oct6100api +EXTRA_CFLAGS = -I$(src)/.. -Wno-undef -I$(src)/include -I$(src)/octdeviceapi -I$(src)/octdeviceapi/oct6100api +lib-y := $(octapi_files) diff --git a/drivers/dahdi/wct4xxp/Kbuild b/drivers/dahdi/wct4xxp/Kbuild index 23e1fa9..4c65d91 100644 --- a/drivers/dahdi/wct4xxp/Kbuild +++ b/drivers/dahdi/wct4xxp/Kbuild @@ -14,7 +14,7 @@ ifeq ($(HOTPLUG_FIRMWARE),yes) EXTRA_CFLAGS+=-DHOTPLUG_FIRMWARE endif -wct4xxp-objs := base.o vpm450m.o $(shell $(src)/../oct612x/octasic-helper objects ../oct612x) +wct4xxp-objs := base.o vpm450m.o ../oct612x/lib.a ifneq ($(HOTPLUG_FIRMWARE),yes) wct4xxp-objs += $(FIRM_DIR)/dahdi-fw-oct6114-064.o $(FIRM_DIR)/dahdi-fw-oct6114-128.o $(FIRM_DIR)/dahdi-fw-oct6114-256.o