# make -f Makefile.ldap
#
# Lib options. Some system require different LIBS

include config.$(config)
include Makefile_$(FIX_OBJ)_fix_obj

#LIBS = -lc -lresolv -llber -lldap
#LIBS = -lresolv -lnsl -lsocket -lldap -llber
#LIBS = -lsocket -lresolv -llber -lldap
#LIBS = -lpthread -lc -lresolv -lsocket -lnsl -lldap50 -llber50
#LIBS = -R /usr/local/lib -lc -lresolv -llber -lldap -lcrypt

#Required for password expire check (add to CFLAGS)
#-DGOT_LDAP_GET_LDERRNO

CC = gcc
LIBS = $(LDAP_LIBS)  -lc -lresolv -lcrypt  
CFLAGS = $(XFLAGS) -Dunix -g  -Dunix_password -DLDAPAUTH -DENABLE_MD5 -DGOT_LDAP_MEMFREE

AUTH_OBJ = 	auth.o ../sam/md5.o ld_sha.o ../sam/base64.o
ADTS_OBJ = 	

# rules to build  
all: clean ldap
	echo "Done!"

ldap: $(AUTH_OBJ) $(ADTS_OBJ) 
	$(CC) -o ldapauth $(CFLAGS) $(AUTH_OBJ) $(ADTS_OBJ) $(LIBS) 

clean:
	rm -f *.o *~ 
