#
# Makefile for CGIWrap
# This file is automatically generated from Makefile.in
#

#
# Compiler definitions and flags
#

#
# modified for debian
#
DESTDIR=

VERSION=@VERSION@
SHELL=/bin/sh

srcdir=@srcdir@
VPATH=@srcdir@
@SET_MAKE@

CC=@CC@
CFLAGS=@GCC_WALL_OPT@ @CFLAGS@ @CPPFLAGS@
LDFLAGS=@LDFLAGS@ @AFSLDFLAGS@
LIBS=@AFSLIBS@ @LIBS@
OBJS=cgiwrap.o debug.o util.o fetch.o stdutil.o msgs.o @GETUSERSHELL@

#
# Dependencies for building cgiwrap
#
all: cgiwrap

.c.o:
	$(CC) -c $(CFLAGS) -I. -I$(srcdir) $<

cgiwrap: $(OBJS)
	$(CC) -o cgiwrap $(OBJS) $(LDFLAGS) $(LIBS)

dep: Makefile
	mv Makefile Makefile.bak
	awk -f $(srcdir)/depend.awk < Makefile.bak > Makefile
	echo '# DO NOT REMOVE THIS LINE' >> Makefile
	$(CC) -MM -I. -I$(srcdir) $(srcdir)/*.c >> Makefile

install: cgiwrap
	@DOINSTALL@ rm -f $(DESTDIR)/@INSTALLDIR@/cgiwrap
	@DOINSTALL@ rm -f $(DESTDIR)/@INSTALLDIR@/cgiwrapd
	@DOINSTALL@ rm -f $(DESTDIR)/@INSTALLDIR@/nph-cgiwrap
	@DOINSTALL@ rm -f $(DESTDIR)/@INSTALLDIR@/nph-cgiwrapd
	@DOINSTALL@ cp cgiwrap.allow $(DESTDIR)/etc/cgiwrap.allow
	@DOINSTALL@ cp cgiwrap.deny $(DESTDIR)/etc/cgiwrap.deny
	@DOINSTALL@ cp cgiwrap.userdir $(DESTDIR)/etc/cgiwrap.userdir
	@DOINSTALL@ cp cgiwrap $(DESTDIR)/@INSTALLDIR@/cgiwrap
	@DOINSTALL@ chown root $(DESTDIR)/@INSTALLDIR@/cgiwrap
	@DOINSTALL@ chgrp @INSTALLGROUP@ $(DESTDIR)/@INSTALLDIR@/cgiwrap
	@DOINSTALL@ chmod @INSTALLMODE@ $(DESTDIR)/@INSTALLDIR@/cgiwrap
	@DOINSTALL@ ln $(DESTDIR)/@INSTALLDIR@/cgiwrap $(DESTDIR)/@INSTALLDIR@/cgiwrapd
	@DOINSTALL@ ln $(DESTDIR)/@INSTALLDIR@/cgiwrap $(DESTDIR)/@INSTALLDIR@/nph-cgiwrap
	@DOINSTALL@ ln $(DESTDIR)/@INSTALLDIR@/cgiwrap $(DESTDIR)/@INSTALLDIR@/nph-cgiwrapd


uninstall:
	@DOINSTALL@ rm -f @INSTALLDIR@/cgiwrap
#	@DOINSTALL@ rm -f @INSTALLDIR@/cgiwrapd
#	@DOINSTALL@ rm -f @INSTALLDIR@/nph-cgiwrap
#	@DOINSTALL@ rm -f @INSTALLDIR@/nph-cgiwrapd

clean:
	rm -f cgiwrap core *~ *.o *.tar Makefile.bak

distclean: clean
	rm -f config.cache config.log config.h config.status Makefile
	rm -f unsup/loganalyze.pl

#
# Dependencies for developing cgiwrap
#
allconf: configure config.h.in Makefile

$(srcdir)/configure: $(srcdir)/configure.in
	autoconf

Makefile: $(srcdir)/Makefile.in
	./config.status

config.h.in: $(srcdir)/acconfig.h
	autoheader

config.h: $(srcdir)/config.h.in
	./config.status

docs: Makefile
	for p in htdocs/*.html; do \
		lynx -nolist -dump $$p > doc/`basename $$p .html`; \
	done

dist:
	rm -rf ../cgiwrap-$(VERSION)
	mkdir ../cgiwrap-$(VERSION)
	touch * */*
	cp -r * ../cgiwrap-$(VERSION)
	cd ../cgiwrap-$(VERSION) && make distclean
	cd ../cgiwrap-$(VERSION) && rm -rf CVS */CVS */*/CVS
	cd ../cgiwrap-$(VERSION) && rm -rf .cvsignore */.cvsignore */*/.cvsignore
	cd ../cgiwrap-$(VERSION) && rm -rf RCS */RCS */*/RCS
	cd ../cgiwrap-$(VERSION) && rm -rf U

tardist: dist	
	rm -f ../cgiwrap-$(VERSION).tar ../cgiwrap-$(VERSION).tar.gz
	gtar -C .. -cvf ../cgiwrap-$(VERSION).tar cgiwrap-$(VERSION)
	gzip -9v ../cgiwrap-$(VERSION).tar

tardistpgp: tardist
	pgp -sba ../cgiwrap-$(VERSION).tar.gz
	rm -f ../cgiwrap-$(VERSION).tar.gz.sig
	mv ../cgiwrap-$(VERSION).tar.gz.asc ../cgiwrap-$(VERSION).tar.gz.sig

commit: configure config.h.in docs
	cvs commit -m "" .

#
# Source file dependencies, replaced by 'make dep'
#
# DO NOT REMOVE THIS LINE
cgiwrap.o: config.h cgiwrap.h cgiwrap.c
debug.o: config.h cgiwrap.h debug.c
util.o: config.h cgiwrap.h util.c
fetch.o: config.h cgiwrap.h fetch.c
stdutil.o: config.h cgiwrap.h stdutil.c
msgs.o: config.h cgiwrap.h msgs.c

