2010-08-18 21:49:24 +08:00
|
|
|
#
|
|
|
|
# Makefile for DAHDI tools
|
|
|
|
#
|
|
|
|
# Copyright (C) 2001-2010 Digium, Inc.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
2014-12-22 04:10:31 +08:00
|
|
|
ifeq ($(strip $(foreach var,clean,$(findstring $(var),$(MAKECMDGOALS)))),)
|
2010-08-18 21:49:24 +08:00
|
|
|
endif
|
|
|
|
|
2014-12-22 04:10:31 +08:00
|
|
|
ifeq ($(strip $(foreach var,clean,$(findstring $(var),$(MAKECMDGOALS)))),)
|
2010-08-18 21:49:24 +08:00
|
|
|
ifneq ($(wildcard makeopts),)
|
|
|
|
include makeopts
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq (,$(findstring ppc,$(UNAME_M)))
|
|
|
|
CFLAGS+=-fsigned-char
|
|
|
|
endif
|
|
|
|
ifneq (,$(findstring x86_64,$(UNAME_M)))
|
|
|
|
CFLAGS+=-m64
|
|
|
|
endif
|
|
|
|
|
|
|
|
ROOT_PREFIX=
|
|
|
|
|
|
|
|
# extra cflags to build dependencies. Recursively expanded.
|
|
|
|
MAKE_DEPS= -MD -MT $@ -MF .$(subst /,_,$@).d -MP
|
|
|
|
|
|
|
|
CFLAGS+=$(DAHDI_INCLUDE)
|
|
|
|
|
|
|
|
CHKCONFIG := $(wildcard /sbin/chkconfig)
|
|
|
|
UPDATE_RCD := $(wildcard /usr/sbin/update-rc.d)
|
|
|
|
ifeq (,$(DESTDIR))
|
|
|
|
ifneq (,$(CHKCONFIG))
|
|
|
|
ADD_INITD := $(CHKCONFIG) --add dahdi
|
|
|
|
else
|
|
|
|
ifneq (,$(UPDATE_RCD))
|
|
|
|
ADD_INITD := $(UPDATE_RCD) dahdi defaults 15 30
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
INITRD_DIR := $(firstword $(wildcard $(DESTDIR)/etc/rc.d/init.d $(DESTDIR)/etc/init.d))
|
|
|
|
ifneq (,$(INITRD_DIR))
|
|
|
|
INIT_TARGET := $(INITRD_DIR)/dahdi
|
|
|
|
COPY_INITD := install -D dahdi.init $(INIT_TARGET)
|
|
|
|
endif
|
|
|
|
|
|
|
|
NETSCR_DIR := $(firstword $(wildcard $(DESTDIR)/etc/sysconfig/network-scripts ))
|
|
|
|
ifneq (,$(NETSCR_DIR))
|
|
|
|
NETSCR_TARGET := $(NETSCR_DIR)/ifup-hdlc
|
|
|
|
COPY_NETSCR := install -D ifup-hdlc $(NETSCR_TARGET)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# sbindir, libdir, includedir and mandir are defined in makeopts
|
|
|
|
# (from configure).
|
|
|
|
LIB_DIR:=$(libdir)
|
2013-05-24 06:52:43 +08:00
|
|
|
|
2010-08-18 21:49:24 +08:00
|
|
|
# All the man pages. Not just installed ones:
|
|
|
|
GROFF_PAGES := $(wildcard doc/*.8 xpp/*.8)
|
|
|
|
GROFF_HTML := $(GROFF_PAGES:%=%.html)
|
|
|
|
|
|
|
|
GENERATED_DOCS := $(GROFF_HTML) README.html README.Astribank.html
|
|
|
|
|
2014-12-22 04:10:31 +08:00
|
|
|
all:
|
2010-08-18 21:49:24 +08:00
|
|
|
|
|
|
|
tonezones.txt: zonedata.c
|
|
|
|
perl -ne 'next unless (/\.(country|description) = *"([^"]*)/); \
|
|
|
|
print (($$1 eq "country")? "* $$2\t":"$$2\n");' $< \
|
|
|
|
>$@
|
|
|
|
|
|
|
|
%.asciidoc: %.sample
|
|
|
|
perl -n -e \
|
|
|
|
'if (/^#($$|\s)(.*)/){ if (!$$in_doc){print "\n"}; $$in_doc=1; print "$$2\n" } else { if ($$in_doc){print "\n"}; $$in_doc=0; print " $$_" }' \
|
|
|
|
$< \
|
|
|
|
| perl -p -e 'if (/^ #?(\w+)=/ && ! exists $$cfgs{$$1}){my $$cfg = $$1; $$cfgs{$$cfg} = 1; s/^/\n[[cfg_$$cfg]]\n/}' >$@
|
|
|
|
|
|
|
|
docs: $(GENERATED_DOCS)
|
|
|
|
|
|
|
|
genconf_parameters.sample: xpp/genconf_parameters
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
README.html: README system.conf.asciidoc init.conf.asciidoc tonezones.txt \
|
2013-10-18 14:27:30 +08:00
|
|
|
UPGRADE.txt genconf_parameters.asciidoc assigned-spans.conf.asciidoc \
|
|
|
|
span-types.conf.asciidoc
|
2013-12-29 19:43:05 +08:00
|
|
|
$(ASCIIDOC) -n -a toc -a toclevels=4 $<
|
2010-08-18 21:49:24 +08:00
|
|
|
|
|
|
|
README.Astribank.html: xpp/README.Astribank
|
|
|
|
$(ASCIIDOC) -o $@ -n -a toc -a toclevels=4 $<
|
|
|
|
|
2014-06-30 18:47:23 +08:00
|
|
|
# on Debian: this requires the full groff, not just groff-base.
|
2010-08-18 21:49:24 +08:00
|
|
|
%.8.html: %.8
|
|
|
|
man -Thtml $^ >$@
|
|
|
|
|
|
|
|
htmlman: $(GROFF_HTML)
|
|
|
|
|
|
|
|
install: all install-programs
|
|
|
|
@echo "###################################################"
|
|
|
|
@echo "###"
|
|
|
|
@echo "### DAHDI tools installed successfully."
|
|
|
|
@echo "### If you have not done so before, install init scripts with:"
|
|
|
|
@echo "###"
|
|
|
|
@echo "### make config"
|
|
|
|
@echo "###"
|
|
|
|
@echo "###################################################"
|
|
|
|
|
2015-05-19 01:19:47 +08:00
|
|
|
install-programs: install-libs
|
2010-08-18 21:49:24 +08:00
|
|
|
|
2014-12-22 04:10:31 +08:00
|
|
|
install-libs:
|
2010-08-18 21:49:24 +08:00
|
|
|
ifneq (no,$(USE_SELINUX))
|
|
|
|
ifeq (,$(DESTDIR))
|
|
|
|
/sbin/restorecon -v $(DESTDIR)$(LIB_DIR)/$(LTZ_SO)
|
|
|
|
endif
|
|
|
|
endif
|
2010-11-30 01:53:50 +08:00
|
|
|
|
2010-08-18 21:49:24 +08:00
|
|
|
config:
|
|
|
|
ifneq (,$(COPY_INITD))
|
|
|
|
$(COPY_INITD)
|
|
|
|
endif
|
|
|
|
ifneq (,$(COPY_NETSCR))
|
|
|
|
$(COPY_NETSCR)
|
|
|
|
endif
|
|
|
|
ifneq (,$(ADD_INITD))
|
|
|
|
$(ADD_INITD)
|
|
|
|
endif
|
|
|
|
@echo "DAHDI has been configured."
|
|
|
|
@echo ""
|
|
|
|
@echo "List of detected DAHDI devices:"
|
|
|
|
@echo ""
|
|
|
|
@if [ `xpp/dahdi_hardware | tee /dev/stderr | wc -l` -eq 0 ]; then \
|
|
|
|
echo "No hardware found"; \
|
|
|
|
else \
|
|
|
|
echo ""; \
|
|
|
|
echo "run 'dahdi_genconf modules' to load support for only " ;\
|
|
|
|
echo "the DAHDI hardware installed in this system. By "; \
|
|
|
|
echo "default support for all DAHDI hardware is loaded at "; \
|
|
|
|
echo "DAHDI start. "; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
clean:
|
2014-12-22 04:10:31 +08:00
|
|
|
rm -f *.o tzdriver
|
2010-08-18 21:49:24 +08:00
|
|
|
rm -f core
|
|
|
|
rm -rf $(GENERATED_DOCS) *.asciidoc tonezones.txt
|
|
|
|
|
2015-05-19 01:19:47 +08:00
|
|
|
.PHONY: clean all install devel data config install-programs install-libs
|
2010-08-18 21:49:24 +08:00
|
|
|
|
|
|
|
FORCE:
|