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

#
# Compiler definitions and flags
#
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 @INSTALLDIR@/cgiwrap
	@DOINSTALLCGIWRAPD@ rm -f @INSTALLDIR@/cgiwrapd
	@DOINSTALLNPH@ rm -f @INSTALLDIR@/nph-cgiwrap
	@DOINSTALLCGIWRAPD@ @DOINSTALLNPH@ rm -f @INSTALLDIR@/nph-cgiwrapd
	@DOINSTALLPHP@ rm -f @INSTALLDIR@/php-cgiwrap
	@DOINSTALLCGIWRAPD@ @DOINSTALLPHP@ rm -f @INSTALLDIR@/php-cgiwrapd
	@DOINSTALL@ cp cgiwrap @INSTALLDIR@/cgiwrap
	@DOINSTALL@ chown root @INSTALLDIR@/cgiwrap
	@DOINSTALL@ chgrp @INSTALLGROUP@ @INSTALLDIR@/cgiwrap
	@DOINSTALL@ chmod @INSTALLMODE@ @INSTALLDIR@/cgiwrap
	@DOINSTALLCGIWRAPD@ ln @INSTALLDIR@/cgiwrap @INSTALLDIR@/cgiwrapd
	@DOINSTALLNPH@ ln @INSTALLDIR@/cgiwrap @INSTALLDIR@/nph-cgiwrap
	@DOINSTALLCGIWRAPD@ @DOINSTALLNPH@ ln @INSTALLDIR@/cgiwrap @INSTALLDIR@/nph-cgiwrapd
	@DOINSTALLPHP@ ln @INSTALLDIR@/cgiwrap @INSTALLDIR@/php-cgiwrap
	@DOINSTALLCGIWRAPD@ @DOINSTALLPHP@ ln @INSTALLDIR@/cgiwrap @INSTALLDIR@/php-cgiwrapd

uninstall:
	@DOINSTALL@ rm -f @INSTALLDIR@/cgiwrap
	@DOINSTALL@ rm -f @INSTALLDIR@/cgiwrapd
	@DOINSTALL@ rm -f @INSTALLDIR@/nph-cgiwrap
	@DOINSTALL@ rm -f @INSTALLDIR@/nph-cgiwrapd
	@DOINSTALL@ rm -f @INSTALLDIR@/php-cgiwrap
	@DOINSTALL@ rm -f @INSTALLDIR@/php-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: 
	autoheader

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

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 autom4te.cache *.rej *.orig
	cd ../cgiwrap-$(VERSION) && rm -rf .#* */.#*
	cd ../cgiwrap-$(VERSION) && rm -rf depend.awk
	cd ../cgiwrap-$(VERSION) && rm -rf make-docs
	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

