# Makefile for dillon's cron and crontab
#

CC  = gcc
CFLAGS = -O2 -Wall -Wstrict-prototypes
LIB = 
SRCS = main.c subs.c database.c job.c
OBJS = main.o subs.o database.o job.o
PROTOS= protos.h

all:	${PROTOS} crond

crond:	${OBJS}
	${CC} ${CFLAGS} -o crond ${OBJS} ${LIB}
	strip crond

protos.h: ${SRCS} ${D_SRCS}
	fgrep -h Prototype ${SRCS} >protos.h

clean:  cleano
	rm -f crond

cleano:
	rm -f *.o dcron.tgz $(PROTOS)

install:
	rm -f /usr/bin/crond
	chown root.wheel /usr/bin/crond
	chmod 700 /usr/bin/crond

tar: cleano
	(cd ..; tar cvf - dcron | gzip -9 >dcron.tgz.tmp)
	mv -f ../dcron.tgz.tmp dcron.tgz

