SHELL = /bin/sh

top_srcdir = @top_srcdir@
srcdir = @srcdir@

prefix = @prefix@
exec_prefix = @exec_prefix@
sbindir = @sbindir@
CC = @CC@
CFLAGS = @CFLAGS@
DEFS = @DEFS@
LDFLAGS = @LDFLAGS@

INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
APXS = @APXS@

DESTDIR =

MAKEDEFS = CC='$(CC)' DEFS='$(DEFS)' CFLAGS='$(CFLAGS)' \
           LDFLAGS='$(LDFLAGS)' prefix='$(prefix)' \
           sbindir='$(sbindir)' DESTDIR='$(DESTDIR)' \
           srcdir='$(srcdir)'

RM = rm -f
INCLUDES = -I$(top_srcdir)/src
EXTRADEFS = -DPATH_TO_SUPHP=\\\"$(sbindir)/suphp\\\"

all: suphp.mod

suphp.mod: mod_suphp.c
	$(APXS) -c $(DEFS) $(EXTRADEFS) $(INCLUDES) -Wc,"$(CFLAGS)" mod_suphp.c

install: suphp.mod
	$(APXS) -i -a mod_suphp.so

clean:
	$(RM) mod_suphp.so mod_suphp.o

