
INSTALL=/usr/local/sbin

nullidentd: nullidentd.c version.h
	gcc -O2 -o nullidentd nullidentd.c

dist: .version
	mkdir nullidentd-`cat .version`
	cp -P `p4 files ... | sed s/\\\\/\\\\/depot\\\\/home\\\\/nullidentd\\\\/// | sed s/#.*$$//` nullidentd-`cat .version`/
	find nullidentd-`cat .version` -type f -exec chmod 664 {} \;
	tar zcf nullidentd-`cat .version`.tar.gz nullidentd-`cat .version`/
	rm -rf nullidentd-`cat .version`

.version: README
	egrep "^Version" README | sed 's/Version //' > .version

version.h: .version
	echo "const char VERSION[] = \"`cat .version`\";" > version.h

clean: 
	rm -f .version version.h nullidentd

install: nullidentd
	rm -f $(INSTALL)/nullidentd
	cp nullidentd $(INSTALL)/nullidentd
	chown root.root $(INSTALL)/nullidentd
	chmod a-rw $(INSTALL)/nullidentd
	chmod a+x $(INSTALL)/nullidentd

