Skip to content

Commit f65299e

Browse files
committed
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 <[email protected]> Signed-off-by: Russ Meyerriecks <[email protected]>
1 parent f4d9cbb commit f65299e

File tree

3 files changed

+35
-39
lines changed

3 files changed

+35
-39
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ include/dahdi/version.h: FORCE
8686
fi
8787
@rm -f $@.tmp
8888

89-
prereq: include/dahdi/version.h firmware-loaders
89+
prereq: include/dahdi/version.h firmware-loaders oct612x-lib
9090

9191
stackcheck: $(CHECKSTACK) modules
9292
objdump -d drivers/dahdi/*.ko drivers/dahdi/*/*.ko | $(CHECKSTACK)
@@ -122,6 +122,9 @@ uninstall-firmware:
122122
firmware-loaders:
123123
$(MAKE) -C drivers/dahdi/firmware firmware-loaders
124124

125+
oct612x-lib:
126+
$(MAKE) -C $(KSRC) M='$(PWD)/drivers/dahdi/oct612x'
127+
125128
install-include:
126129
for hdr in $(INST_HEADERS); do \
127130
install -D -m 644 include/dahdi/$$hdr $(DESTDIR)/usr/include/dahdi/$$hdr; \
@@ -189,6 +192,7 @@ ifneq (no,$(HAS_KSRC))
189192
endif
190193
@rm -f $(GENERATED_DOCS)
191194
$(MAKE) -C drivers/dahdi/firmware clean
195+
$(MAKE) -C $(KSRC) M='$(PWD)/drivers/dahdi/oct612x' clean
192196

193197
distclean: dist-clean
194198

drivers/dahdi/oct612x/Makefile

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,30 @@
1-
CFLAGS=-V3.4 -ffunction-sections -I/lib/modules/$(shell uname -r)/build/include -Iinclude -Ioctdeviceapi -Ioctdeviceapi/oct6100api -DGFP_ATOMIC=0 -Dkmalloc=calloc -Dkfree=free
2-
LDFLAGS=-V3.4 -Wl,-Map -Wl,test.map -Wl,--gc-sections
1+
#
2+
# Produces the oct612x library
3+
#
4+
octapi_files = octdeviceapi/oct6100api/oct6100_api/oct6100_adpcm_chan.o \
5+
octdeviceapi/oct6100api/oct6100_api/oct6100_channel.o \
6+
octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.o \
7+
octdeviceapi/oct6100api/oct6100_api/oct6100_chip_stats.o \
8+
octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.o \
9+
octdeviceapi/oct6100api/oct6100_api/oct6100_debug.o \
10+
octdeviceapi/oct6100api/oct6100_api/oct6100_events.o \
11+
octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.o \
12+
octdeviceapi/oct6100api/oct6100_api/oct6100_memory.o \
13+
octdeviceapi/oct6100api/oct6100_api/oct6100_miscellaneous.o \
14+
octdeviceapi/oct6100api/oct6100_api/oct6100_mixer.o \
15+
octdeviceapi/oct6100api/oct6100_api/oct6100_phasing_tsst.o \
16+
octdeviceapi/oct6100api/oct6100_api/oct6100_playout_buf.o \
17+
octdeviceapi/oct6100api/oct6100_api/oct6100_remote_debug.o \
18+
octdeviceapi/oct6100api/oct6100_api/oct6100_tlv.o \
19+
octdeviceapi/oct6100api/oct6100_api/oct6100_tone_detection.o \
20+
octdeviceapi/oct6100api/oct6100_api/oct6100_tsi_cnct.o \
21+
octdeviceapi/oct6100api/oct6100_api/oct6100_tsst.o \
22+
apilib/bt/octapi_bt0.o \
23+
apilib/largmath/octapi_largmath.o \
24+
apilib/llman/octapi_llman.o
325

4-
APIDIR=octdeviceapi/oct6100api/oct6100_api
5-
6-
OCTASIC_OBJS=$(APIDIR)/oct6100_adpcm_chan.o \
7-
$(APIDIR)/oct6100_channel.o \
8-
$(APIDIR)/oct6100_chip_open.o \
9-
$(APIDIR)/oct6100_chip_stats.o \
10-
$(APIDIR)/oct6100_conf_bridge.o \
11-
$(APIDIR)/oct6100_debug.o \
12-
$(APIDIR)/oct6100_events.o \
13-
$(APIDIR)/oct6100_interrupts.o \
14-
$(APIDIR)/oct6100_memory.o \
15-
$(APIDIR)/oct6100_miscellaneous.o \
16-
$(APIDIR)/oct6100_mixer.o \
17-
$(APIDIR)/oct6100_phasing_tsst.o \
18-
$(APIDIR)/oct6100_playout_buf.o \
19-
$(APIDIR)/oct6100_remote_debug.o \
20-
$(APIDIR)/oct6100_tlv.o \
21-
$(APIDIR)/oct6100_tone_detection.o \
22-
$(APIDIR)/oct6100_tsi_cnct.o \
23-
$(APIDIR)/oct6100_tsst.o \
24-
$(APIDIR)/oct6100_user.o \
25-
apilib/bt/octapi_bt0.o \
26-
apilib/largmath/octapi_largmath.o \
27-
apilib/llman/octapi_llman.o
28-
29-
30-
all: test
31-
32-
test.o: test.c
33-
34-
test: test.o $(OCTASIC_OBJS)
35-
36-
clean:
37-
rm -rf test test.o
38-
rm -rf $(OCTASIC_OBJS)
26+
# TODO: ccflags was added in 2.6.24 in commit f77bf01425b11947eeb3b5b54. This
27+
# should be changed to a conditional compilation based on the Kernel Version.
28+
# ccflags-y := -I$(src)/.. -Wno-undef -I$(src)/include -I$(src)/octdeviceapi -I$(src)/octdeviceapi/oct6100api
29+
EXTRA_CFLAGS = -I$(src)/.. -Wno-undef -I$(src)/include -I$(src)/octdeviceapi -I$(src)/octdeviceapi/oct6100api
30+
lib-y := $(octapi_files)

drivers/dahdi/wct4xxp/Kbuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ifeq ($(HOTPLUG_FIRMWARE),yes)
1414
EXTRA_CFLAGS+=-DHOTPLUG_FIRMWARE
1515
endif
1616

17-
wct4xxp-objs := base.o vpm450m.o $(shell $(src)/../oct612x/octasic-helper objects ../oct612x)
17+
wct4xxp-objs := base.o vpm450m.o ../oct612x/lib.a
1818

1919
ifneq ($(HOTPLUG_FIRMWARE),yes)
2020
wct4xxp-objs += $(FIRM_DIR)/dahdi-fw-oct6114-064.o $(FIRM_DIR)/dahdi-fw-oct6114-128.o $(FIRM_DIR)/dahdi-fw-oct6114-256.o

0 commit comments

Comments
 (0)