#!/usr/bin/make
#
# $Id: Makefile,v 1.1 2003/10/31 13:52:26 dexter Exp $

# Make script adapted from libapache-auth-ldap Debian package
# for mod_auth_plain.c

# Copyright (C), 1998, 1999 Enbridge Pipelines Inc.
# Copyright (C), 1999 Dave Carrigan
# Copyright (C), 2001 Piotr Roszatycki

# Where to find apxs. Could be in the sbin or the bin directory
 APXS=/usr/bin/apxs

# Add any extra flags you need to compile
 EXTRA_CFLAGS= -Wall

# You shouldn't need to change anything below here. If you do, report it
# as a bug.

OBJS=mod_auth_plain.o

CC=`$(APXS) -q CC`
CFLAGS=`$(APXS) -q CFLAGS` $(EXTRA_CFLAGS)
CFLAGS_SHLIB=`$(APXS) -q CFLAGS_SHLIB` 
INCLUDEDIR=`$(APXS) -q INCLUDEDIR`
LD_SHLIB=`$(APXS) -q LD_SHLIB`
LDFLAGS_SHLIB=`$(APXS) -q LDFLAGS_SHLIB`

mod_auth_plain.so: $(OBJS)
	@echo $(LD_SHLIB) $(LDFLAGS_SHLIB) -o $@ $(OBJS) $(LIBS)
	@$(LD_SHLIB) $(LDFLAGS_SHLIB) -o $@ $(OBJS) $(LIBS) 

%.o: %.c
	@echo $(CC) -c -o $@ $(CFLAGS) $(CFLAGS_SHLIB) -I$(INCLUDEDIR) $(INCLUDES) $<
	@$(CC) -c -o $@ $(CFLAGS) $(CFLAGS_SHLIB) -I$(INCLUDEDIR) $(INCLUDES) $<

install: mod_auth_plain.so
	$(APXS) -i $(ACTIVATE) mod_auth_plain.so

clean:
	rm -f *.so *.o *~ core $(AIX_EXP)

$(AIX_EXP):
	@echo mod_auth_plain > $@
