PROJ = btrax
VER = 1.0.0
PREFIX = /usr/local
USE_KPROBES =
export PREFIX USE_KPROBES

all:
	$(MAKE) -C module
	$(MAKE) -C src
	$(MAKE) -C scripts

clean:
	$(MAKE) -C module clean
	$(MAKE) -C src clean
	$(MAKE) -C scripts clean

install:
	@( if [ ! -d $(PREFIX)/bin ]; then \
	       echo "Making directory " $(PREFIX)/bin; \
	       mkdir -p $(PREFIX)/bin; \
	   fi; )
	$(MAKE) -C module install
	$(MAKE) -C src install
	$(MAKE) -C scripts install
	$(MAKE) -C man install
	$(MAKE) -C include install

uninstall:
	$(MAKE) -C module uninstall
	$(MAKE) -C src uninstall
	$(MAKE) -C scripts uninstall
	$(MAKE) -C man uninstall
	$(MAKE) -C include uninstall

test:
	$(MAKE) -C src test

distclean:
	find . -depth -type d -name 'CVS' -exec rm -rf {} \;
	$(MAKE) clean

dist:
	$(MAKE) distclean
	cd ..; mv $(PROJ) $(PROJ)-$(VER); \
		tar jcvf $(PROJ)-$(VER).tar.bz2 $(PROJ)-$(VER)

save:
	$(MAKE) clean
	cd ..; tar jcvf $(PROJ)-`date +%Y%m%d%H%M`.tar.bz2 $(PROJ)
