summaryrefslogtreecommitdiff
path: root/drivers/dahdi/xpp/Kbuild
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2008-06-19 13:36:15 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2008-06-19 13:36:15 +0000
commit9d886a8e34490fabc3a1e3a0ebba5f8a43a6fd49 (patch)
tree8ac596c49aed7284efdb19c2b97900248436aa44 /drivers/dahdi/xpp/Kbuild
parent55896756afb1dc68c66712885cd310f8a11494e2 (diff)
Further XPP driver adjustments:
* More complete Kconfig. * Verification of FXO init script moved here from tools. * Perl init scripts are verified. * Correct name XppConf*ig*. * Add the files for xpp_mmap . git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4408 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/xpp/Kbuild')
-rw-r--r--drivers/dahdi/xpp/Kbuild60
1 files changed, 47 insertions, 13 deletions
diff --git a/drivers/dahdi/xpp/Kbuild b/drivers/dahdi/xpp/Kbuild
index 3f0774e..6d4db4c 100644
--- a/drivers/dahdi/xpp/Kbuild
+++ b/drivers/dahdi/xpp/Kbuild
@@ -1,9 +1,3 @@
-ifdef SUBDIRS
- ZAP_KERNEL = $(SUBDIRS)
-else
- ZAP_KERNEL = $(M)
-endif
-
EXTRA_CFLAGS = $(XPP_LOCAL_CFLAGS) \
-DDEBUG \
-DPOLL_DIGITAL_INPUTS \
@@ -13,20 +7,22 @@ EXTRA_CFLAGS = $(XPP_LOCAL_CFLAGS) \
-g
#
+WITH_BRISTUFF := $(shell grep '^[[:space:]]*\#[[:space:]]*define[[:space:]]\+CONFIG_ZAPATA_BRI_DCHANS\>' $(src)/../dahdi_config.h)
+
obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_XPP) += xpp.o
-obj-$(CONFIG_DAHDI_XPP_USB) += xpp_usb.o
obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_XPD_FXS) += xpd_fxs.o
obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_XPD_FXO) += xpd_fxo.o
obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_XPD_PRI) += xpd_pri.o
-
-HAS_BRISTUFF := $(shell grep '^[[:space:]]*\#[[:space:]]*define[[:space:]]\+CONFIG_ZAPATA_BRI_DCHANS\>' $(ZAP_KERNEL)/dahdi_config.h)
+ifneq (,$(WITH_BRISTUFF))
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_XPD_BRI) += xpd_bri.o
+endif
# Build only supported modules
ifneq (,$(filter y m,$(CONFIG_USB)))
-obj-m += xpp_usb.o
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_XPP_USB) += xpp_usb.o
endif
-ifneq (,$(HAS_BRISTUFF))
-obj-m += xpd_bri.o
+ifneq (,$(filter y m,$(CONFIG_BF537)))
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_XPP_MMAP) += xpp_mmap.o
endif
xpp-objs += xbus-core.o xbus-sysfs.o xbus-pcm.o xframe_queue.o xpp_zap.o xproto.o card_global.o zap_debug.o
@@ -34,6 +30,7 @@ xpd_fxs-objs += card_fxs.o
xpd_fxo-objs += card_fxo.o
xpd_bri-objs += card_bri.o
xpd_pri-objs += card_pri.o
+xpp_mmap-objs += mmapbus.o mmapdrv.o
ifeq (y,$(PARPORT_DEBUG))
EXTRA_CFLAGS += -DDEBUG_SYNC_PARPORT
@@ -42,7 +39,7 @@ endif
# Handle versioning
XPP_VERSION_STR ?= $(shell if [ -r $(obj)/.version ]; then echo "\"`cat $(obj)/.version`\""; else echo '"Unknown"'; fi)
-clean-files := xpp_version.h
+clean-files += xpp_version.h
$(obj)/card_fxs.o $(obj)/card_fxo.o $(obj)/card_bri.o $(obj)/card_pri.o $(obj)/xpp_usb.o $(obj)/xpp.o: $(obj)/xpp_version.h
@@ -53,5 +50,42 @@ $(obj)/xpp_version.h: FORCE
fi
$(Q)rm -f $@.tmp
+# Validations:
+# - Syntactic verification of perl scripts
+# - Handle country table validation for init_card_2_*
+
+XPP_PROTOCOL_VERSION := $(shell grep XPP_PROTOCOL_VERSION $(src)/xproto.h | sed -e 's/^.*XPP_PROTOCOL_VERSION[ \t]*//')
+
+xpp_verifications = \
+ init_card_1_$(XPP_PROTOCOL_VERSION) \
+ init_card_2_$(XPP_PROTOCOL_VERSION) \
+ init_card_3_$(XPP_PROTOCOL_VERSION) \
+ init_card_4_$(XPP_PROTOCOL_VERSION) \
+ init_fxo_modes
+
+xpp_verified = $(foreach file, $(xpp_verifications), $(file).verified)
+
+FXO_MODES = $(src)/../fxo_modes.h
+FXO_VERIFY = $(obj)/init_card_2_$(XPP_PROTOCOL_VERSION) -v $(obj)/init_fxo_modes
+
+hostprogs-y := print_fxo_modes
+always := $(xpp_verified)
+print_fxo_modes-objs := print_fxo_modes.o
+HOSTCFLAGS_print_fxo_modes.o += -include $(FXO_MODES)
+
+clean-files += print_fxo_modes init_fxo_modes $(xpp_verified)
+
+$(obj)/init_fxo_modes: $(obj)/print_fxo_modes
+ @echo ' GEN $@'
+ $(Q)$(obj)/print_fxo_modes >$@ || (rm -f $@; exit 1)
+
+$(obj)/init_fxo_modes.verified: $(obj)/init_card_2_$(XPP_PROTOCOL_VERSION) $(obj)/init_fxo_modes
+ @echo ' CHECK $(obj)/init_card_2_$(XPP_PROTOCOL_VERSION)'
+ $(Q)$(FXO_VERIFY) && touch $@ || (rm -f $@; exit 1)
+
+$(obj)/init_card_%_$(XPP_PROTOCOL_VERSION).verified: $(src)/init_card_%_$(XPP_PROTOCOL_VERSION)
+ @echo ' VERIFY $<'
+ $(Q)perl -c $< 2> $@ || (cat $@; rm -f $@; exit 1)
+
.PHONY: FORCE
FORCE: