#
# This Makefile is used for compatibility to the
# isdn4k-utils package. In order to superseede
# the original Makefile, it is called GNUmakefile.
#

ifeq (../.config,$(wildcard ../.config))
	include ../.config
	BUILDOPTS   :=
	#
	# Install as root with numeric Id's, since these are the
	# only ones that _really_ exist on _every_ system.
	#
	INSTALLOPTS += INSTALL= install -o 0 -g 0 -m 644
endif

all: .depend
	$(MAKE) -f Makefile $(BUILDOPTS) all

.depend:
	$(MAKE) -f Makefile depend

config:
#	@cp Makefile.in GNUmakefile
	@echo '/*' > policy.h
	@echo ' * Automatically generated by config: DO NOT EDIT' >> policy.h
	@echo ' */' >> policy.h
	@echo '#ifndef _POLICY_H_' >> policy.h
	@echo '#define _POLICY_H_' >> policy.h
	@echo '#include "../scripts/autoconf.h"' >> policy.h
	@echo '#define I4LCONFDIR CONFIG_I4LCONFDIR' >> policy.h
	@echo '#define CONFFILE CONFIG_CONFFILE' >> policy.h
	@echo '#define CALLERIDFILE CONFIG_CALLERIDFILE' >> policy.h
	@echo '#define USERCONFFILE CONFIG_USERCONFFILE' >> policy.h
	@echo '#define RUNDIR CONFIG_RUNDIR' >> policy.h
	@echo '#define LOCKDIR CONFIG_LOCKDIR' >> policy.h
	@echo '#define LOCKFILE CONFIG_LOCKFILE' >> policy.h
	@echo '#define S_COUNTRY_PREFIX CONFIG_COUNTRY_PREFIX' >> policy.h
	@echo '#define S_AREA_PREFIX CONFIG_AREA_PREFIX' >> policy.h
	@echo '#endif' >> policy.h

clean:
	$(MAKE) -f Makefile clean

distclean:
	$(MAKE) -f Makefile distclean
	rm -f GNUmakefile policy.h

#
# Currently isdnlib.a is used in place.
#
# TODO: build a shared version and install it.
#
