
default:
	@echo "Please specify a make target: install, dist, clean."
	
clean:
	rm -f `find . -name \*~`

# Get the version from usr/sbin/laptop_mode.
VERSION :=$(shell cat usr/sbin/laptop_mode | grep "LMTVERSION=" | sed 's/LMTVERSION=//g')

version:
	@echo $(VERSION)

dist:
	if [ `whoami` == "bsamwel" ] ; then cp ~/public_html/laptop_mode/tools/faq.html Documentation ; fi
	if [ `whoami` == "bsamwel" ] ; then cp ~/public_html/laptop_mode/tools/revision-history.html Documentation ; fi
	rm -rf ../dist/laptop-mode-tools-$(VERSION)
	mkdir -p ../dist/laptop-mode-tools-$(VERSION)
	cp -a * ../dist/laptop-mode-tools-$(VERSION)
	@# Remove Subversion stuff before distributing! 
	rm -rf `find ../dist/laptop-mode-tools-$(VERSION) -name .svn`
	cd ../dist && tar cvzf laptop-mode-tools_$(VERSION).tar.gz laptop-mode-tools-$(VERSION)
	rm -rf ../dist/laptop-mode-tools-$(VERSION)

install:
	./install.sh
