####################################################################
# Description: Makefile to construct "TARGET".
#
# Created: Sun 30.11.1996 by althaus@genetik.uni-koeln.de
# last change 9.1.1997
#

###################################################################
#
# simple makefile to construct a single target
#
TARGET=dcf77

###################################################################
#
# Compiler- and Linker-flags:
#
CFLAGS	= -O2 -Wall -funroll-loops # with O2 because "inline extern" ...
LFLAGS	= # this flags will be add to lflags.

###################################################################
#
# Place of installation:
#
DEST=/usr/local/sbin

###################################################################
#
# Files for distribution:
#
DIST=Makefile dcf77.c dcf77.h dcf77.lsm rc.dcf77 README version.sh

###################################################################
#
# Root of man pages.  Subdirectories will be ${MANDIR}/man1,
#
# no man page aviable for now.
#MANDIR=/usr/local/man

NOCR=-n

all: $(TARGET)

clean:;	rm $(TARGET) *.o

$(TARGET).o: $(TARGET).c
	@echo $(NOCR) "Compiling $(TARGET).c ... " &&\
	$(CC) -c $(CFLAGS) $(TARGET).c -o $(TARGET).o &&\
	echo done.

$(TARGET): $(TARGET).o
	@echo ${NOCR} "Linking $(TARGET) ... " &&\
	$(CC) $(TARGET).o $(LFLAGS) -o $(TARGET) &&\
	echo done.

install: all
	@echo ${NOCR} "Installing $(TARGET) binary in $(DEST) ... " &&\
	install -s -g bin -o root -m 0755 $(TARGET) $(DEST)/$(TARGET) &&\
	echo done.

dist:;	@VERSION=`./version.sh $(TARGET).h`; \
	echo "building archive for $(TARGET)-dist of version $$VERSION ..." ; \
	if [ -e ../$(TARGET)-$$VERSION ] ; \
	then rm -rf ../$(TARGET)-$$VERSION ; fi ; \
	mkdir ../$(TARGET)-$$VERSION ; cp $(DIST) ../$(TARGET)-$$VERSION ; \
	cd .. ; tar -czf $(TARGET)-$${VERSION}.tgz $(TARGET)-$$VERSION

depend:;echo $(NOCR) "Adding dependings to Makefile ... "
	makedepend -f Makefile -- $(CFLAGS) -- $(TARGET).c -o .o
	echo done.

# do not delete the next line, makedeped depends on it!
# DO NOT DELETE

dcf77.o: dcf77.h /usr/include/stdio.h /usr/include/libio.h
dcf77.o: /usr/include/features.h /usr/include/sys/cdefs.h
dcf77.o: /usr/include/gnu/stubs.h /usr/include/_G_config.h
dcf77.o: /usr/include/gnu/types.h
dcf77.o: /usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3/include/stddef.h
dcf77.o: /usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3/include/stdarg.h
dcf77.o: /usr/include/stdio_lim.h /usr/include/signal.h /usr/include/sigset.h
dcf77.o: /usr/include/signum.h /usr/include/sigaction.h
dcf77.o: /usr/include/sigcontext.h /usr/include/asm/sigcontext.h
dcf77.o: /usr/include/sys/time.h /usr/include/time.h /usr/include/timebits.h
dcf77.o: /usr/include/sys/select.h /usr/include/selectbits.h
dcf77.o: /usr/include/termios.h /usr/include/termbits.h
dcf77.o: /usr/include/sys/ttydefaults.h /usr/include/unistd.h
dcf77.o: /usr/include/posix_opt.h /usr/include/confname.h
dcf77.o: /usr/include/asm/io.h /usr/include/sys/timex.h
dcf77.o: /usr/include/linux/timex.h /usr/include/fcntl.h
dcf77.o: /usr/include/fcntlbits.h /usr/include/sys/types.h
dcf77.o: /usr/include/endian.h /usr/include/bytesex.h /usr/include/sys/stat.h
dcf77.o: /usr/include/statbuf.h
