# makefile for cookie program   4/8/88 remote from sugar

all:	cookie cookhash cookies

cookie:	cookie.c
	cc -O -o cookie cookie.c

cookhash:	cookhash.c
	cc -O -o cookhash cookhash.c

cookies:	cookies.aa cookies.ab
	cat cookies.aa cookies.ab > cookies

install:
	# Need a cookie group. This will return False if the group preexists, so we ignore its exit code.
	groupadd cookie || true
	cp cookie cookhash /usr/local/bin/.
	chgrp cookie /usr/local/bin/cookie
	chmod 2755 /usr/local/bin/cookie
	cp cookies /usr/local/lib/.
	cookhash < /usr/local/lib/cookies > /usr/local/lib/cookie.hash

clean:
	rm -f cookie cookhash