#
# Makefile	Makefile for mod_auth_radius.
#		Needs GNU make, sorry about that.
#
# Version:	$Id: Makefile,v 1.5 2001/02/20 12:46:50 miquels Exp $
#

PKG	= libapache-auth-radius-1.0

CC	= $(shell apxs -q CC)
FLAGS	= $(shell apxs -q CFLAGS)
INC	= $(shell apxs -q INCLUDEDIR)
CFLAGS	= $(FLAGS) -I$(INC) -fPIC

LD	= $(shell apxs -q LD_SHLIB)
LDFLAGS = $(shell apxs -q LDFLAGS_SHLIB)
LIBS	= $(shell apxs -q LIBS_SHLIB)

mod_auth_radius.so: radius.o auth.o
	$(LD) $(LDFLAGS) -o mod_auth_radius.so radius.o auth.o $(LIBS)

radius.o: radius.c

auth.o: auth.c

clean:
	rm -f *.o *.a *.so

release:
	rm -rf tmp
	rm -f ../$(PKG).tar.gz
	mkdir tmp
	mkdir tmp/$(PKG)
	tar cf - . | ( cd tmp/$(PKG) && tar xpf - )
	( cd tmp/$PKG; \
	  find tmp/ -name CVS -o -name tmp -o -name '.??*' | xargs rm -rf )
	( cd tmp && tar cvf ../../$(PKG).tar $(PKG) )
	gzip ../$(PKG).tar
	rm -rf tmp

install:	mod_auth_radius.so
	apxs -n radius_auth -i mod_auth_radius.so

