# Makefile for the dfingerd, Copyright (c) 1999 David Lichteblau
# Please read the files README, INSTALL and the LICENSE!

# Configurable Section

INSTALL_DIR = /usr/local/sbin

D2C = d2c
MELANGE = melange
CC = gcc
MKDIR = mkdirhier
INSTALL = install -c

D2CFLAGS = 
# Use this if your version of d2c doesn't have 'with-open-file':
#D2CFLAGS = -Dhave-no-with-open-file
MELANGEFLAGS = --d2c -I`gcc -print-file-name=include`
CFLAGS = 


# Chaos

INTRSRC = unix.dylan
DYLANSRC = dfingerd-library.dylan misc.dylan tools.dylan dfingerd.dylan

.PHONY: veryclean distclean install


all: dfingerd


unix.dylan: unix.intr c/wrappers.h
	$(MELANGE) $(MELANGEFLAGS) unix.intr unix.dylan

c/wrappers.o: c/wrappers.h c/wrappers.c
	$(CC) $(CFLAGS) -c -o c/wrappers.o c/wrappers.c


dfingerd: $(INTRSRC) c/wrappers.o $(DYLANSRC) dfingerd.lid
	$(D2C) $(D2CFLAGS) $@.lid


clean:	
	@echo Cleaning uses dangerously many wildcards!
	@echo Call 'make veryclean' to really do it.

veryclean:
	-rm -f $(INTRSRC)
	-rm -f cc-dfingerd-files.mak *.o *.c *.s *.a
	-rm -f c/*.o
	-rm -f dfingerd

distclean: veryclean
	-rm -f *~
	-rm -f c/*~


install:
	-$(MKDIR) $(INSTALL_DIR)
	$(INSTALL) dfingerd $(INSTALL_DIR)/dfingerd
	@echo You can reconfigure inetd now.

# EOF