Revert "Remove support for xpp drivers."
[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 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_XPP)               += xpp/
45
46 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECHOCAN_JPAH)      += dahdi_echocan_jpah.o
47 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECHOCAN_STEVE)     += dahdi_echocan_sec.o
48 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECHOCAN_STEVE2)    += dahdi_echocan_sec2.o
49 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECHOCAN_KB1)       += dahdi_echocan_kb1.o
50 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECHOCAN_MG2)       += dahdi_echocan_mg2.o
51
52 obj-m += $(DAHDI_MODULES_EXTRA)
53
54 # If you want to build OSLEC, include the code in the standard location:
55 # drivers/staging/echo . The DAHDI OSLEC echo canceller will be built as
56 # well:
57 ifneq (,$(wildcard $(src)/../staging/echo/echo.c))
58 obj-m += dahdi_echocan_oslec.o
59 obj-m += ../staging/echo/echo.o
60 endif
61
62 CFLAGS_MODULE += -I$(DAHDI_INCLUDE) -I$(src) -Wno-format-truncation
63
64 ifndef HOTPLUG_FIRMWARE
65 ifneq (,$(filter y m,$(CONFIG_FW_LOADER)))
66 HOTPLUG_FIRMWARE := yes
67 else
68 HOTPLUG_FIRMWARE := no
69 endif
70 export HOTPLUG_FIRMWARE
71 endif
72
73 # fix typo present in CentOS and RHEL 2.6.9 kernels
74 BAD_KERNELS_VERS := 22 34 34.0.1 34.0.2
75 BAD_KERNELS := $(foreach ver,$(BAD_KERNELS_VERS),2.6.9-$(ver).EL 2.6.9-$(ver).ELsmp)
76 ifneq (,$(filter $(KVERS),$(BAD_KERNELS)))
77 EXTRA_CFLAGS+=-Drw_lock_t=rwlock_t
78 endif
79
80 # A number of Fedora 10 (9 also?) kernels backported hrtimer to 2.6.27
81 # as part of an ALSA backport. TODO: Any better way to detect that?
82 ifeq (1,$(shell fgrep -q ' hrtimer_set_expires' include/linux/hrtimer.h 2>/dev/null && echo 1))
83 EXTRA_CFLAGS+=-DHAVE_HRTIMER_ACCESSORS=1
84 endif
85
86 ifeq (1,$(shell fgrep -q 'wait_for_completion_timeout' include/linux/completion.h 2>/dev/null && echo 1))
87 CFLAGS_MODULE+=-DHAVE_WAIT_FOR_COMPLETION_TIMEOUT=1
88 endif
89
90 # In 2.6.18 skb_linearize changed; however, some distros backported the change
91 ifneq (,$(wildcard $(srctree)/include/linux/skbuff.h))
92 ifeq ($(shell grep "skb_linearize.*(.*, .* gfp)" $(srctree)/include/linux/skbuff.h),)
93 CFLAGS_dahdi_dynamic_eth.o := -DNEW_SKB_LINEARIZE
94 CFLAGS_dahdi_dynamic_ethmf.o := -DNEW_SKB_LINEARIZE
95 endif
96 endif
97
98 dahdi-objs := dahdi-base.o dahdi-sysfs.o dahdi-sysfs-chan.o dahdi-version.o
99
100 ###############################################################################
101 # Find appropriate ARCH value for VPMADT032 and HPEC binary modules
102 ###############################################################################
103
104 ifeq ($(ARCH),i386)
105   DAHDI_ARCH=x86_32
106 else
107   ifeq ($(ARCH),x86_64)
108     DAHDI_ARCH=x86_64
109   else
110     ifeq ($(ARCH),x86)
111       ifeq ($(CONFIG_X86_32),y)
112         DAHDI_ARCH=x86_32
113       else
114         DAHDI_ARCH=x86_64
115       endif
116     else
117 $(warning CPU Architecture '$(ARCH)' does not support VPMADT032 or HPEC. Skipping.)
118     endif
119   endif
120 endif
121
122 ###############################################################################
123 # VPMADT032 Loader
124 ###############################################################################
125
126 dahdi_vpmadt032_loader-objs := vpmadt032_loader/dahdi_vpmadt032_loader.o 
127
128 ifneq ($(DAHDI_ARCH),)
129   ifneq ($(wildcard $(src)/vpmadt032_loader/vpmadt032_$(DAHDI_ARCH).o_shipped),)
130     VPMADT032_LOADER_PRESENT=yes
131     dahdi_vpmadt032_loader-objs += vpmadt032_loader/vpmadt032_$(DAHDI_ARCH).o
132     obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_VPMADT032_LOADER)      += dahdi_vpmadt032_loader.o
133   endif
134 endif
135
136 ###############################################################################
137 # HPEC Support 
138 ###############################################################################
139
140 dahdi_echocan_hpec-objs := hpec/dahdi_echocan_hpec.o
141 CFLAGS_dahdi_echocan_hpec.o := -I$(src)/hpec
142
143 ifneq ($(DAHDI_ARCH),)
144   ifneq ($(wildcard $(src)/hpec/hpec_$(DAHDI_ARCH).o_shipped),)
145     HPEC_PRESENT=yes
146     dahdi_echocan_hpec-objs += hpec/hpec_$(DAHDI_ARCH).o
147   endif
148 endif
149
150 ifeq ($(HPEC_PRESENT),yes)
151 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECHOCAN_HPEC)      += dahdi_echocan_hpec.o
152 endif
153
154
155 hostprogs-y := makefw
156
157
158
159 clean-files     := radfw.h