#
# GNU Makefile
#   for the valueconstraint Netscape Directory Server 6 plug-in.
#
# From the book "Understanding and Deploying LDAP Directory Services"
#	by Timothy A. Howes, Mark C. Smith, and Gordon S. Good.
#
# Based on the slapi plugin example Makefile from Netscape.
#

DS_INSTALL_DIR=/export/ds6
PLUGINNAME=valueconstraint

LD = ld
CC = cc -v -g

DS_PLUGIN_DIR=$(DS_INSTALL_DIR)/plugins/slapd/slapi

OBJS	= $(PLUGINNAME).o
CFLAGS	= -I$(DS_PLUGIN_DIR)/include -D_REENTRANT -KPIC
LDFLAGS	= -G
LIBS	= $(DS_INSTALL_DIR)/lib/libslapd.so \
			$(DS_INSTALL_DIR)/lib/libnspr4.so

all:	plugin

plugin:	$(PLUGINNAME).so

$(PLUGINNAME).so: $(OBJS)
	$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)

.c.o:
	$(CC) $(CFLAGS) -c $<

clean:	FORCE
	-rm -f $(OBJS) $(PLUGINNAME).so

FORCE:
