#
# Makefile get/set power-on time
#
# Defines you can put in CFLAGS for unctime.y:
# -DBSD=1       use gettimeofday() for timezone correction
# -DFTIME=1     use ftime() for timezone correction
# (default)     use tzset() for timezone correction

CFLAGS = -O -DBSD

all: setpwr getpwr ctime getdate
       
getpwr: getpwr.o power.c 
	$(CC) $(CFLAGS) -o getpwr getpwr.o power.c 

setpwr: setpwr.o power.c
	$(CC) $(CFLAGS) -o setpwr setpwr.o power.c 

nvram.o: nvram.s
	$(CC) $(CFLAGS) -c nvram.s

y.tab.c: getdate.y
	$(YACC) getdate.y

getdate: getdate.c y.tab.c
	$(CC) $(CFLAGS) -o getdate y.tab.c getdate.c

ctime: ctime.c
	$(CC) -o ctime ctime.c

clean:
	rm -f *.o
	rm -f y.tab.c
	rm -f getpwr setpwr getdate ctime

