6d9b91c1b87b6230383be888d2f8580b746d0064
[dahdi/linux.git] / drivers / dahdi / Kbuild
1 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI)                   += dahdi.o
2 #obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_DUMMY)            += dahdi_dummy.o
3 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_DYNAMIC)           += dahdi_dynamic.o
4 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_DYNAMIC_LOC)       += dahdi_dynamic_loc.o
5 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_DYNAMIC_ETH)       += dahdi_dynamic_eth.o
6 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_DYNAMIC_ETHMF)     += dahdi_dynamic_ethmf.o
7 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_TRANSCODE)         += dahdi_transcode.o
8
9 ifdef CONFIG_PCI
10 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_OCT612X)           += oct612x/
11 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCT4XXP)           += wct4xxp/
12 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTC4XXP)          += wctc4xxp/
13 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTDM24XXP)        += wctdm24xxp/
14 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTE13XP)          += wcte13xp.o
15
16 wcte13xp-objs := wcte13xp-base.o wcxb_spi.o wcxb.o wcxb_flash.o
17 CFLAGS_wcte13xp-base.o += -I$(src)/oct612x -I$(src)/oct612x/include -I$(src)/oct612x/octdeviceapi -I$(src)/oct612x/octdeviceapi/oct6100api
18 ifeq ($(HOTPLUG_FIRMWARE),yes)
19   CFLAGS_wcte13xp-base.o += -DHOTPLUG_FIRMWARE
20 endif
21
22 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTE43X)           += wcte43x.o
23
24 wcte43x-objs := wcte43x-base.o wcxb_spi.o wcxb.o wcxb_flash.o
25 CFLAGS_wcte43x-base.o += -I$(src)/oct612x -I$(src)/oct612x/include -I$(src)/oct612x/octdeviceapi -I$(src)/oct612x/octdeviceapi/oct6100api
26 ifeq ($(HOTPLUG_FIRMWARE),yes)
27   CFLAGS_wcte43x-base.o += -DHOTPLUG_FIRMWARE
28 endif
29
30 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCAXX)             += wcaxx.o
31
32 wcaxx-objs := wcaxx-base.o wcxb_spi.o wcxb.o wcxb_flash.o
33 CFLAGS_wcaxx-base.o += -I$(src)/oct612x/ -I$(src)/oct612x/include -I$(src)/oct612x/octdeviceapi -I$(src)/oct612x/octdeviceapi/oct6100api
34 ifeq ($(HOTPLUG_FIRMWARE),yes)
35   CFLAGS_wcaxx-base.o += -DHOTPLUG_FIRMWARE
36 endif
37
38 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_VOICEBUS)          += voicebus/
39 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCB4XXP)           += wcb4xxp/
40
41
42 endif
43
44
45 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECHOCAN_JPAH)      += dahdi_echocan_jpah.o
46 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECHOCAN_STEVE)     += dahdi_echocan_sec.o
47 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECHOCAN_STEVE2)    += dahdi_echocan_sec2.o
48 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECHOCAN_KB1)       += dahdi_echocan_kb1.o
49 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECHOCAN_MG2)       += dahdi_echocan_mg2.o
50
51 obj-m += $(DAHDI_MODULES_EXTRA)
52
53 # If you want to build OSLEC, include the code in the standard location:
54 # drivers/staging/echo . The DAHDI OSLEC echo canceller will be built as
55 # well:
56 ifneq (,$(wildcard $(src)/../staging/echo/echo.c))
57 obj-m += dahdi_echocan_oslec.o
58 obj-m += ../staging/echo/echo.o
59 endif
60
61 CFLAGS_MODULE += -I$(DAHDI_INCLUDE) -I$(src) -Wno-format-truncation
62
63 ifndef HOTPLUG_FIRMWARE
64 ifneq (,$(filter y m,$(CONFIG_FW_LOADER)))
65 HOTPLUG_FIRMWARE := yes
66 else
67 HOTPLUG_FIRMWARE := no
68 endif
69 export HOTPLUG_FIRMWARE
70 endif
71
72 # fix typo present in CentOS and RHEL 2.6.9 kernels
73 BAD_KERNELS_VERS := 22 34 34.0.1 34.0.2
74 BAD_KERNELS := $(foreach ver,$(BAD_KERNELS_VERS),2.6.9-$(ver).EL 2.6.9-$(ver).ELsmp)
75 ifneq (,$(filter $(KVERS),$(BAD_KERNELS)))
76 EXTRA_CFLAGS+=-Drw_lock_t=rwlock_t
77 endif
78
79 # A number of Fedora 10 (9 also?) kernels backported hrtimer to 2.6.27
80 # as part of an ALSA backport. TODO: Any better way to detect that?
81 ifeq (1,$(shell fgrep -q ' hrtimer_set_expires' include/linux/hrtimer.h 2>/dev/null && echo 1))
82 EXTRA_CFLAGS+=-DHAVE_HRTIMER_ACCESSORS=1
83 endif
84
85 ifeq (1,$(shell fgrep -q 'wait_for_completion_timeout' include/linux/completion.h 2>/dev/null && echo 1))
86 CFLAGS_MODULE+=-DHAVE_WAIT_FOR_COMPLETION_TIMEOUT=1
87 endif
88
89 # In 2.6.18 skb_linearize changed; however, some distros backported the change
90 ifneq (,$(wildcard $(srctree)/include/linux/skbuff.h))
91 ifeq ($(shell grep "skb_linearize.*(.*, .* gfp)" $(srctree)/include/linux/skbuff.h),)
92 CFLAGS_dahdi_dynamic_eth.o := -DNEW_SKB_LINEARIZE
93 CFLAGS_dahdi_dynamic_ethmf.o := -DNEW_SKB_LINEARIZE
94 endif
95 endif
96
97 dahdi-objs := dahdi-base.o dahdi-sysfs.o dahdi-sysfs-chan.o dahdi-version.o
98
99 ###############################################################################
100 # Find appropriate ARCH value for VPMADT032 and HPEC binary modules
101 ###############################################################################
102
103 ifeq ($(ARCH),i386)
104   DAHDI_ARCH=x86_32
105 else
106   ifeq ($(ARCH),x86_64)
107     DAHDI_ARCH=x86_64
108   else
109     ifeq ($(ARCH),x86)
110       ifeq ($(CONFIG_X86_32),y)
111         DAHDI_ARCH=x86_32
112       else
113         DAHDI_ARCH=x86_64
114       endif
115     else
116 $(warning CPU Architecture '$(ARCH)' does not support VPMADT032 or HPEC. Skipping.)
117     endif
118   endif
119 endif
120
121 ###############################################################################
122 # VPMADT032 Loader
123 ###############################################################################
124
125 dahdi_vpmadt032_loader-objs := vpmadt032_loader/dahdi_vpmadt032_loader.o 
126
127 ifneq ($(DAHDI_ARCH),)
128   ifneq ($(wildcard $(src)/vpmadt032_loader/vpmadt032_$(DAHDI_ARCH).o_shipped),)
129     VPMADT032_LOADER_PRESENT=yes
130     dahdi_vpmadt032_loader-objs += vpmadt032_loader/vpmadt032_$(DAHDI_ARCH).o
131     obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_VPMADT032_LOADER)      += dahdi_vpmadt032_loader.o
132   endif
133 endif
134
135 ###############################################################################
136 # HPEC Support 
137 ###############################################################################
138
139 dahdi_echocan_hpec-objs := hpec/dahdi_echocan_hpec.o
140 CFLAGS_dahdi_echocan_hpec.o := -I$(src)/hpec
141
142 ifneq ($(DAHDI_ARCH),)
143   ifneq ($(wildcard $(src)/hpec/hpec_$(DAHDI_ARCH).o_shipped),)
144     HPEC_PRESENT=yes
145     dahdi_echocan_hpec-objs += hpec/hpec_$(DAHDI_ARCH).o
146   endif
147 endif
148
149 ifeq ($(HPEC_PRESENT),yes)
150 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECHOCAN_HPEC)      += dahdi_echocan_hpec.o
151 endif
152
153
154 hostprogs-y := makefw
155
156
157
158 clean-files     := radfw.h