--- /dev/null
+bin_PROGRAMS = cgi-fcgi
+
+INCLUDEDIR = $(srcdir)/../include
+CFLAGS = @CCDEFS@ -I$(INCLUDEDIR)
+
+INCLUDE_FILES = $(INCLUDEDIR)/fastcgi.h \
+ $(INCLUDEDIR)/fcgiapp.h \
+ $(INCLUDEDIR)/fcgimisc.h
+
+LIBDIR = $(srcdir)/../libfcgi
+LIBFCGI = $(LIBDIR)/libfcgi.la
+
+LDADD = $(LIBFCGI)
+cgi_fcgi_SOURCES = $(INCLUDE_FILES) cgi-fcgi.c
+++ /dev/null
-#
-# Makefile for CGI -> FCGI application
-#
-# $Id: Makefile.in,v 1.4 2001/09/01 01:06:12 robs Exp $
-#
-
-SHELL = @SHELL@
-O = @OBJEXT@
-L = @L@
-CC = @CC@
-EXEEXT = @EXEEXT@
-
-INCLUDEDIR = ../include
-CFLAGS = @CCDEFS@ -I$(INCLUDEDIR)
-LIBS = @LIBS@
-RANLIB = @RANLIB@
-
-OBJS = fcgiapp.${O}
-
-INCLUDES = $(INCLUDEDIR)/fastcgi.h \
- $(INCLUDEDIR)/fcgiapp.h \
- $(INCLUDEDIR)/fcgimisc.h
-
-LIBDIR = ../libfcgi
-LIBFCGI = $(LIBDIR)/libfcgi.${L}
-TARGETS = cgi-fcgi
-
-all: $(TARGETS)
-
-cgi-fcgi: cgi-fcgi.${O} $(LIBFCGI)
- $(CC) $(CFLAGS) cgi-fcgi.${O} -o cgi-fcgi $(LIBFCGI) $(LIBS)
-
-clean:
- rm -f *.${L} *.${O} core.* errs *~ \#* TAGS *.E a.out ${TARGETS:=$(EXEEXT)}
-
-# ----------------------------------------------------------------------------
-
-cgi-fcgi.${O}: cgi-fcgi.c $(INCLUDES)