LDAPSRC = @LDAPSRC@
LDAPINC = @LDAPINC@
LDAPLIB = @LDAPLIB@
KRB5SRC = @KRB5SRC@
KRB5INC = @KRB5INC@
KRB5LIB = @KRB5LIB@
KRB5CRYPTO = @KRB5CRYPTO@
GSSLDAPLIB = @GSSLDAPLIB@

SHELL = @SHELL@
srcdir = @srcdir@
VPATH = @srcdir@

CC = @CC@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
DEFS = @DEFS@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@

prefix = @prefix@
exec_prefix = @exec_prefix@
transform = @program_transform_name@
sbindir = $(exec_prefix)/sbin

KRB5LIBS= $(KRB5LIB) -lgssapi_krb5 -lkrb5 $(KRB5CRYPTO) -lcom_err
LDAPLIBS= $(LDAPLIB) -lldap -llber
ADLIBS= -L../AD -lAD -L../locator -llocator -L../krb5passwd -lkrb5passwd $(GSSLDAPLIB)
DEPADLIBS= ../AD/libAD.a ../locator/liblocator.a ../krb5passwd/libkrb5passwd.a 
COMPILE = $(CC) -c $(DEFS) -DDEF_SHELL=\"$(SHELL)\" $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
LINK = $(CC) $(LDFLAGS) -o $@

.SUFFIXES:
.SUFFIXES: .c .o
.c.o:
	$(COMPILE) $<

ADINC = -I.. -I../locator -I../AD -I../krb5passwd -I../gsssasl

INCLUDES = $(LDAPINC) $(KRB5INC) $(ADINC)

HEADERS = 
SOURCES = pwdump.c
OBJECTS = pwdump.o

DISTFILES = Makefile.in $(HEADERS) $(SOURCES)

all: pwdump

pwdump: pwdump.o $(DEPADLIBS)
	$(LINK) pwdump.o $(ADLIBS) $(LDAPLIBS) $(KRB5LIBS) $(LIBS)

install: all
	$(srcdir)/../mkinstalldirs $(sbindir)
	$(INSTALL_PROGRAM) pwdump $(sbindir)/`echo pwdump | sed '$(transform)'`

uninstall:
	rm -f $(sbindir)/`echo pwdump | sed '$(transform)'`

tags: TAGS

TAGS: $(HEADERS) $(SOURCES)
	cd $(srcdir) && etags -i ../lib/TAGS $(HEADERS) $(SOURCES)

mostlyclean:
	rm -f *.o core core.*

clean: mostlyclean
	rm -f pwdump

distclean: clean
	rm -f Makefile

realclean: distclean
	rm -f TAGS

dist: $(DISTFILES)
	@echo "Copying distribution files"
	@for file in $(DISTFILES); do \
	  ln $(srcdir)/$$file ../$(PRODUCT)-$(VERSION)/src 2> /dev/null \
	    || cp -p $(srcdir)/$$file ../$(PRODUCT)-$(VERSION)/src; \
	done

Makefile: Makefile.in ../config.status
	cd .. && CONFIG_FILES=pwdump/$@ CONFIG_HEADERS= ./config.status

# Tell versions [3.59,3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
