Revert "Remove support for xpp drivers."
[dahdi/linux.git] / drivers / dahdi / xpp / Kbuild
1 EXTRA_CFLAGS    =       $(XPP_LOCAL_CFLAGS)     \
2                         -DDEBUG                 \
3                         -DPOLL_DIGITAL_INPUTS   \
4                         -DDEBUG_PCMTX           \
5                         -DPROTOCOL_DEBUG        \
6                         -g
7                         #
8
9 WITH_BRISTUFF   := $(shell grep -c '^[[:space:]]*\#[[:space:]]*define[[:space:]]\+CONFIG_DAHDI_BRI_DCHANS\>' $(src)/../../../include/dahdi/dahdi_config.h)
10
11 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_XPP)               += xpp.o
12 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_XPD_FXS)           += xpd_fxs.o
13 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_XPD_FXO)           += xpd_fxo.o
14 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_XPD_PRI)           += xpd_pri.o
15 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_XPD_BRI)           += xpd_bri.o
16 obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_XPD_ECHO)          += xpd_echo.o
17
18 # Build only supported modules
19 ifneq   (,$(filter y m,$(CONFIG_USB)))
20 obj-$(DAHDI_BUILD_ALL)$(CONFIG_XPP_USB)                 += xpp_usb.o
21 endif
22 ifneq   (,$(filter y m,$(CONFIG_BF537)))
23 obj-$(DAHDI_BUILD_ALL)$(CONFIG_XPP_MMAP)                += xpp_mmap.o
24 endif
25
26 xpp-objs                += xbus-core.o xbus-sysfs.o xbus-pcm.o xframe_queue.o xpp_dahdi.o xproto.o card_global.o dahdi_debug.o
27 xpd_fxs-objs            += card_fxs.o
28 xpd_fxo-objs            += card_fxo.o
29 xpd_bri-objs            += card_bri.o
30 xpd_pri-objs            += card_pri.o
31 xpd_echo-objs           += card_echo.o
32 xpp_mmap-objs           += mmapbus.o mmapdrv.o
33
34 ifeq    (y,$(PARPORT_DEBUG))
35 EXTRA_CFLAGS    += -DDEBUG_SYNC_PARPORT
36 obj-m           += parport_debug.o
37 endif
38
39 # Just in case it was left from an older version:
40 clean-files     += xpp_version.h
41
42 # Validations:
43 #  - Syntactic verification of perl scripts
44 #  - Handle country table validation for init_card_2_*
45
46 XPP_PROTOCOL_VERSION    := $(shell grep XPP_PROTOCOL_VERSION $(src)/xproto.h | sed -e 's/^.*XPP_PROTOCOL_VERSION[ \t]*//')
47
48 xpp_verifications               = \
49                                 init_card_1_$(XPP_PROTOCOL_VERSION)     \
50                                 init_card_2_$(XPP_PROTOCOL_VERSION)     \
51                                 init_card_3_$(XPP_PROTOCOL_VERSION)     \
52                                 init_card_4_$(XPP_PROTOCOL_VERSION)     \
53                                 init_fxo_modes
54
55 xpp_verified                    = $(foreach file, $(xpp_verifications), $(file).verified)
56
57 FXO_MODES  = $(src)/../fxo_modes.h
58 FXO_VERIFY = $(obj)/init_card_2_$(XPP_PROTOCOL_VERSION) -v $(obj)/init_fxo_modes
59
60 hostprogs-y                     := print_fxo_modes
61 always                          := $(xpp_verified)
62 print_fxo_modes-objs            := print_fxo_modes.o
63 HOSTCFLAGS_print_fxo_modes.o    += -include $(FXO_MODES)
64
65 clean-files                     += print_fxo_modes init_fxo_modes $(xpp_verified)
66
67 $(obj)/init_fxo_modes: $(obj)/print_fxo_modes
68         @echo '  GEN     $@'
69         $(Q)$(obj)/print_fxo_modes >$@ || (rm -f $@; exit 1)
70
71 $(obj)/init_fxo_modes.verified: $(obj)/init_card_2_$(XPP_PROTOCOL_VERSION) $(obj)/init_fxo_modes
72         @echo '  CHECK   $(obj)/init_card_2_$(XPP_PROTOCOL_VERSION)'
73         $(Q)$(FXO_VERIFY) || (rm -f $@; exit 1)
74         $(Q)touch $@
75
76 $(obj)/init_card_%_$(XPP_PROTOCOL_VERSION).verified: $(src)/init_card_%_$(XPP_PROTOCOL_VERSION)
77         @echo '  VERIFY  $<'
78         $(Q)perl -c $< 2> $@ || (cat $@; rm -f $@; exit 1)
79
80 .PHONY: FORCE
81 FORCE: