#
# TCP/IP remote date/time client
#
#RPM_PROG = rpm-1.4
RPM_PROG = rpm
PACKAGENAME = getdate_rfc868-1.2
TARFILE =  $(PACKAGENAME).tar.gz
SPECFILE = $(PACKAGENAME).spec
SPECLOC = /usr/src/redhat/SPECS
SOURCELOC = /usr/src/redhat/SOURCES

PREFIX = /usr

BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/man/man8

# -fno-strength-reduce is in case this gcc has a bug.
# Linux has the adjtime() call for safe time adjustment.
# Can add -DNEED_STIME if your operating system doesn't have stime().
CFLAGS = -O2 -fno-strength-reduce -DHAVE_ADJTIME


all: getdate

rpm: spotless
	(cd ..; tar cvzf $(SOURCELOC)/$(TARFILE) $(PACKAGENAME) ) ; \
	cp $(SPECFILE) $(SPECLOC)/$(SPECFILE)
	$(RPM_PROG) -ba -v $(SPECFILE)

clean:
	-rm *.o *~

spotless: clean
	-rm getdate

install: all
	install -s getdate $(BINDIR)

installman:
	install getdate.8 $(MANDIR)
