#
# Copyright 2002 Sun Microsystems, Inc. All Rights Reserved
# Use of this product is subject to license terms.
#
# RedHat 7.2 Makefile for Directory Server plug-in example clients
#

LIBDIR        = ../../../../../lib
INCLUDE_FLAGS = -I../../include
CFLAGS        = $(INCLUDE_FLAGS) -Wall
LDFLAGS       = -L$(LIBDIR) -lldap50 -lsasl -lpthread -Xlinker -R -Xlinker $(LIBDIR)

# We must build 32-bit objects on 64-bit machines if the installed
# libraries are 32-bit.
ifeq ($(shell uname -m),x86_64)
  ifeq ($(shell file -L $(LIBDIR)/libldap50.so | cut -d" " -f3),32-bit)
    CFLAGS      += -m32
  endif
endif

CLIENTS       = reqextop saslclient

all:        $(CLIENTS)

reqextop:           reqextop.c
	$(CC) $(CFLAGS) $(LDFLAGS) -o reqextop reqextop.c

saslclient:         saslclient.c
	$(CC) $(CFLAGS) $(LDFLAGS) -o saslclient saslclient.c

clean:
	-rm -f $(CLIENTS)

