summaryrefslogtreecommitdiff
path: root/kernel/xpp/utils/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/xpp/utils/Makefile')
-rw-r--r--kernel/xpp/utils/Makefile12
1 files changed, 9 insertions, 3 deletions
diff --git a/kernel/xpp/utils/Makefile b/kernel/xpp/utils/Makefile
index d8290eb..2e3624c 100644
--- a/kernel/xpp/utils/Makefile
+++ b/kernel/xpp/utils/Makefile
@@ -37,7 +37,7 @@ PERL_MODS := $(shell cd zconf; echo $(PERL_MODS_PAT))
XPD_FIRMWARE = $(wildcard ../firmwares/*.hex)
XPD_INIT_DATA = $(XPD_FIRMWARE) init_fxo_modes
-XPD_INIT = $(wildcard ../init_card_?_*) ../calibrate_slics xpp_fxloader
+XPD_INIT = $(wildcard ../init_card_?_*) xpp_fxloader
# Variables that should be defined above, but need sane defaults:
# FIXME: Are those values really sane?
@@ -49,6 +49,8 @@ ifeq (,$(PBX_LIBUSB))
PBX_LIBUSB = $(shell if [ -r /usr/include/usb.h ]; then echo 1; else echo 0; fi)
endif
+WCTDM=$(shell for i in $(ZAP_KERNEL)/wctdm.c $(ZAP_KERNEL)/fxo_modes.h; do [ -f "$$i" ] && echo "$$i"; done)
+
CFLAGS = -g -Wall $(EXTRA_CFLAGS)
%.8: %
@@ -124,8 +126,12 @@ test_parse.o: test_parse.c hexfile.h
test_parse: test_parse.o libhexfile.a
$(CC) -L. -o $@ $@.o $(EXTRA_LIBS) -lhexfile -lusb
-print_modes: print_modes.c $(ZAP_KERNEL)/fxo_modes.h
- $(HOSTCC) -I$(ZAP_KERNEL) -o $@ $(CFLAGS) $<
+print_modes: print_modes.c wctdm_fxomodes.h
+ $(HOSTCC) -o $@ $(CFLAGS) $<
+
+wctdm_fxomodes.h: $(WCTDM)
+ @echo Building FXO modes from: $(WCTDM)
+ perl -n -e 'print if (/^static struct fxo_mode {$$/ .. /};$$/)' $(WCTDM) >$@ || rm -f $@
init_fxo_modes: print_modes
./$< >$@