#
# Makefile for getpath
# Yes, it's gnu-make specific.
#


CC=gcc
CFLAGS=-I/usr/include -O2 -Wall
LDLIBS=

BASE=/usr
VERSION=1.1

CFLAGS+=-DVERSION=\"$(VERSION)\"
DISTDIR=getpath-$(VERSION)


all: getpath

getpath: getpath.o

install: getpath
	install -c -s -m 0555 getpath $(BASE)/bin/getpath
	install -c -m 0444 getpath.8 $(BASE)/man/man8/getpath.8
	[ -f /etc/getpath.conf ] || install -c -m 0644 getpath.conf /etc/getpath.conf

depend:
	makedepend -- $(CFLAGS) -- *.c

clean:
	rm -rf *.o *.bak *~

distclean: clean
	rm -rf getpath-[0-9].[0-9]* getpath

distlist: distclean
DISTLIST=$(shell find $(PWD) -mindepth 1 -maxdepth 1)

distdir: distlist
	mkdir $(DISTDIR)
	cp -a $(DISTLIST) $(DISTDIR)

dist: distdir
	tar chozf $(DISTDIR).tar.gz $(DISTDIR)
	rm -rf $(DISTDIR)
