# Copyright (c) 2003-2018
# Distributed Systems Software.  All rights reserved.
# See the file LICENSE for redistribution information.
#
# $Id: Makefile 3001 2018-01-31 22:13:26Z brachman $

INSTALLDIR=../install

INCLUDES=include/radlib_private.h include/radlib_vs.h ../include/radlib.h

# Define WITH_SSL to use OpenSSL's hash functions (NOT tested)
#CFLAGS=-g -Wall -DWITH_SSL -fPIC -I./include -I../include -I../../../include

CFLAGS=-g -Wall -DUSE_DACS -fPIC -I./include -I../include -I../../../include \
	-I/usr/local/expat-2.2.5/include -I/usr/local/openssl-1.0.2n/include

radlib.o:	radlib.c $(INCLUDES)
	gcc -c $(CFLAGS) radlib.c

libradius.a:	radlib.o
	ar rv libradius.a radlib.o
	ranlib libradius.a

# No shared library for now... this requires help by the main configure.ac
#libradius.so:	radlib.o
#	gcc -shared -o libradius.so radlib.o

all:	libradius.a

install:	all
	cp libradius.a $(INSTALLDIR)/lib
	cp ../include/radlib.h $(INSTALLDIR)/include

clean:
	rm -f radlib.o libradius.a

veryclean:
	@($(MAKE) clean)
	rm -f $(INSTALLDIR)/lib/libradius.a
	rm -f $(INSTALLDIR)/include/radlib.a
