# Makefile
# This file holds the make rules for Yate script files

# override DESTDIR at install time to prefix the install directory
DESTDIR :=

SCRIPTS := leavemail.php voicemail.php route.php queue_in.php queue_out.php
SCRLIBS := libyate.php libyateivr.php libyatechan.php libvoicemail.php \
	libyate.py \
	Yate.pm

prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
datadir = @datadir@
shrdir = $(datadir)/yate
scrdir = $(shrdir)/scripts

# include optional local make rules
-include YateLocal.mak

.PHONY: all
all:

.PHONY: install
install:
	@cd @srcdir@ && mkdir -p "$(DESTDIR)$(scrdir)/" && \
	install -m 0644 $(SCRLIBS) "$(DESTDIR)$(scrdir)/" && \
	test -z "$(SCRIPTS)" || \
	install $(SCRIPTS) "$(DESTDIR)$(scrdir)/"

.PHONY: uninstall
uninstall:
	@-for i in $(SCRIPTS) $(SCRLIBS) ; do \
	    rm "$(DESTDIR)$(scrdir)/$$i" ; \
	done;
	@-rmdir "$(DESTDIR)$(scrdir)"
	@-rmdir "$(DESTDIR)$(shrdir)"

Makefile: @srcdir@/Makefile.in ../../config.status
	cd ../.. && ./config.status
