VERSION=0.7.2beta
SUBDIRS=isdn icn teles doc tools
# Where to install the mapages
export MANDEST = /usr/local/man
# Where to install the modules ($KERNELDIR/modules)
export KERNELDIR = /usr/src/linux
export INCLUDES = ../include
export CC = gcc -I$(INCLUDES)
export MCFLAGS = -m486 -O6 -Wall -D__KERNEL__ -DLINUX -DMODULE
#
# Use next Definition of CFLAGS to get Assembler-Listings for extensive
# debugging
#export MCFLAGS = -m486 -g -v --save-temps -O6 -Wall -D__KERNEL__ -DLINUX -DMODULE
export PCFLAGS = -O2 -Wall

all: subdirs

devices:
	@echo Making device-nodes ...
	@bash makedev.sh

subdirs:
	set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i; done

clean:
	set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean; done
	rm -f *.[iso] *~ core include/*~ tools/*~

dist: clean
	@cd .. && tar cvzXf isdn/tarExclude distisdn/isdn4linux${VERSION}.tar.gz isdn
	@echo isdn4linux${VERSION}.tar.gz > ../distisdn/version

install: all
	set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install; done
	@echo ''
	@echo ''
	@echo "Don't forget to execute \"make modules_install\" in $(KERNELDIR)"
	@echo 'and after this, "/sbin/depmod -a"'
	@echo ''
	# cd $(KERNELDIR); make modules_install; /sbin/depmod -a

install-man: ;
	set -e; $(MAKE) -C doc install

