#*****************************************************************************
#  This sample is supplied as is with no implied warranty.  
#  It is designed to assist you in using the Cisco AnyConnect VPN API. 
#  It is assumed that you will build a production application and 
#  refer to this sample as a reference only.
#*****************************************************************************
CXX = llvm-g++-4.2
CXXFLAGS = -arch i386 -DHAVE_CONFIG_H -D_NOEXPORTDLL -g -O0 -Wall ${INCLUDES}
INCLUDES = -I. -I../../include -I/usr/include/libxml2
VPNLIB_DIR = ../../lib/MAC/Intel
LIBS = -lvpnapi -lxml2 -lz -lvpncommoncrypt -lvpncommon -lpthread ${VPNLIB_DIR}/libaccurl.a -lacciscocrypto -lacciscossl -lresolv
LIBDIRS = -L${VPNLIB_DIR} 
LDFLAGS=-g

all: client install_libacciscocrypto install_libacciscossl

client: CLIClientMain.o CLIClientImpl.o
	@echo "compiling client"
	${CXX} ${CXXFLAGS} ${LDFLAGS} ${INCLUDES} ${LIBDIRS} -o client -framework SystemConfiguration -framework Security -framework CoreFoundation -framework CoreServices CLIClientMain.o CLIClientImpl.o ${LIBS}

install_libacciscocrypto: client
	install_name_tool -change libacciscocrypto.dylib ${VPNLIB_DIR}/libacciscocrypto.dylib client

install_libacciscossl: client
	install_name_tool -change libacciscossl.dylib ${VPNLIB_DIR}/libacciscossl.dylib client

clean:
	rm -f *.o client
