#
# linux-identd - an identification daemon for Linux
# Copyright (c) 2001-2003 by Per Liden <per@fukt.bth.se>
#

VERSION = 1.3

DESTDIR =
SBINDIR = /usr/sbin
MANDIR = /usr/man

CC = gcc
CFLAGS = -DVERSION=\"$(VERSION)\" -Wall -O2 $(CEXTRAS)
#CFLAGS += -DDEBUG

all: identd identd.8

identd: identd.o
	$(CC) $(LDFLAGS) $^ -o $@

identd.8: identd.8.in
	sed -e "s/#VERSION#/$(VERSION)/" $< > $@

.PHONY:	install dist clean

install: all
	install -d $(DESTDIR)$(SBINDIR)
	install -d $(DESTDIR)$(MANDIR)/man8
	install -m 0755 identd $(DESTDIR)$(SBINDIR)/identd
	install -m 0644 identd.8 $(DESTDIR)$(MANDIR)/man8/identd.8
	ln -s identd $(DESTDIR)$(SBINDIR)/in.identd

dist: clean
	(cd ..; tar czvf linux-identd-$(VERSION).tar.gz linux-identd-$(VERSION))

clean:
	rm -f *~ *.o identd identd.8
