PACKAGE = 'ixcan'
VERSION = '0.2.2'

all: modules library example

modules:
	cd driver/;\
	make

example:
	@if [ -e examples/Makefile ]; then      \
	cd examples/;				\
	make;					\
	fi

library:
	@if [ -e lib/Makefile ]; then           \
	cd lib/;                                \
	make;                                   \
	fi

clean:
	$(MAKE) -C driver/ clean
	@if [ -e examples/Makefile ]; then      \
        $(MAKE) -C examples/ clean;		\
        fi
	@if [ -e lib/Makefile ]; then      \
        $(MAKE) -C lib/ clean;             \
        fi

distclean:
	@if [ -e examples/Makefile ]; then	\
	$(MAKE) -C examples/ distclean;		\
	fi
	@if [ -e driver/Makefile ]; then	\
        $(MAKE) -C driver/ distclean;		\
        fi	
	@if [ -e lib/Makefile ]; then        \
        $(MAKE) -C lib clean;           \
        $(MAKE) -C lib distclean;           \
        fi

release:
	rm -f lib/src/pisocan.c

	rm -f lib/src/pisodnm.c include/dnmglobal.h include/dnmmaster_info.h include/dnmthreadfun.h include/connection_object.h include/internal_func.h include/maptable.h

	rm -f lib/src/pisocpm.c include/communication.h include/cpmglobal.h include/cpmmasterinfo.h include/cpmthreadfun.h
