######################################################################
#
#  A minimal 'Makefile', by Alan DeKok <aland@freeradius.org>
#
# $Id: Makefile,v 1.9 2001/08/20 17:16:44 aland Exp $
#
#############################################################################

VERSION=1.3.14

######################################################################
#
# If we're really paranoid, use these flags
#CFLAGS = -Wall -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Waggregate-return
#
#  If you're not using GCC, then you'll have to change the CFLAGS.
#
CFLAGS = -Wall -fPIC

######################################################################
#
#  The default rule to build everything.
#
all: pam_radius_auth.so

######################################################################
#
#  Build the object file from the C source.
#
pam_radius_auth.o: pam_radius_auth.c pam_radius_auth.h
	$(CC) $(CFLAGS) -c pam_radius_auth.c -o pam_radius_auth.o

######################################################################
#
#  Build the shared library.
#
#  The -Bshareable flag *should* work on *most* operating systems.
#
#  On Solaris, you might try using '-G', instead.
#
pam_radius_auth.so: pam_radius_auth.o md5.o
	ld -Bshareable pam_radius_auth.o md5.o -lpam -o pam_radius_auth.so

######################################################################
#
#  Check a distribution out of the source tree, and make a tar file.
#
dist:
	cvs export -D now -d pam_radius-${VERSION} pam_radius
	tar -cf pam_radius-${VERSION}.tar pam_radius-${VERSION}
	rm -rf pam_radius-${VERSION}

######################################################################
#
#  Clean up everything
#
clean:
	@rm -f *~ *.so *.o
