# Makefile for rwhod++
#
# $Revision: 1.3 $

SHELL   = /bin/sh
LIBS	= @LIBS@
CC	= @CC@
CFLAGS	= @CFLAGS@
DEFS	= @DEFS@

SOURCES	= \
	rwhod++.c

OBJECTS	= \
	rwhod++.o

ALL	= rwhod++

all:    $(ALL)

.c.o:
	$(CC) $(CFLAGS) $(DEFS) -c $<

rwhod++: $(OBJECTS)
	$(CC) -o $@ $(OBJECTS) $(LIBS)

clean:
	rm -f *.o $(ALL)

distclean maintainer-clean: clean
	rm -f Makefile config.status config.cache config.log

Makefile: Makefile.in config.status
	$(SHELL) config.status

config.status: configure
	$(SHELL) config.status --recheck

configure: configure.in
	autoconf

GTAR    = gtar
TAR     = tar
GZIP    = gzip

DISTF   = README COPYRIGHT Makefile.in configure.in configure rwhod++.1\
          rwhod++.c support

dist:
	echo rwhod++-`grep "^This is release" README |awk '{print $$4}'` >.rel
	rm -rf `cat .rel`
	mkdir `cat .rel`
	for i in $(DISTF) ;\
	do \
	    (cd `cat .rel`; ln -s ../$$i) \
	done
	if [ -f ExcludeFiles ]; then \
	    $(GTAR) -cvf `cat .rel`.tar -h -X ExcludeFiles `cat .rel`; \
	else \
	    $(TAR) -chvf `cat .rel`.tar `cat .rel`; \
	fi
	$(GZIP) -f `cat .rel`.tar
	rm -rf `cat .rel` .rel
