DEPTH		= ../../../../..

LDAPSRC		= ../..

RM		= rm -f
SED		= sed

SRCS		= decode.c \
		  encode.c \
		  io.c \
		  bprint.c

REALOBJS	= $(SRCS:.c=.o)

#OBJS		= $(REALOBJS) versiont.o
OBJS		= $(REALOBJS) 

HDIR		= $(LDAPSRC)/include

LIBRARY_NAME	= lber

#
# DEFS are included in CFLAGS
#
DEFS		= $(PLATFORMCFLAGS) $(LDAP_DEBUG) $(KERBEROS) $(AFSKERBEROS) \
		  $(UOFM) $(UOFA) $(NO_USERINTERFACE) $(CLDAP) $(NO_CACHE) \
		  $(LDAP_REFERRALS) $(LDAP_DNS) $(STR_TRANSLATION) \
		  $(LIBLDAP_CHARSETS) $(LIBLDAP_DEF_CHARSET) \
		  $(SLAPD_BACKENDS) $(LDBMBACKEND) $(LDBMINCLUDE) $(PHONETIC)

include $(DEPTH)/config/rules.mk

LOCAL_INCLUDES  = -I$(PUBLIC)/nspr
INCLUDES	+= -I$(HDIR)
DEFINES		+= $(DEFS)

PLATFORMCFLAGS	= -DUSE_WAITPID -DNEEDPROTOS
PLATFORMLIBS	=
THREADS		=
THREADSLIB	=

#
# To build slapd (the stand-alone ldap daemon), uncomment the MAKESLAPD
# line and select the SLAPD_BACKENDS you want to use. If you enable the
# LDBM backend, also select one of the LDBM backends.
#
MAKESLAPD	= yes
SLAPD_BACKENDS	= -DLDAP_LDBM -DLDAP_SHELL -DLDAP_PASSWD
LDBMBACKEND	= -DLDBM_USE_NDBM

#
# uncomment this line to enable debugging code (a good idea)
#
ifndef BUILD_OPT
LDAP_DEBUG	= -DLDAP_DEBUG
endif

#
# uncomment this line to enable support for LDAP referrals in libldap
#
LDAP_REFERRALS	= -DLDAP_REFERRALS

###########################################################################

versiont.c:	Makefile.client Version.c
	@$(RM) $@
	@(u="$${USER-root}" v="$(shell cat ../../build/version)" d="$(shell pwd)" \
	h="$(shell hostname)" t="$(shell date)"; $(SED) -e "s|%WHEN%|$${t}|" \
	-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
	-e "s|%VERSION%|$${v}|" \
	< Version.c > $@)

$(LIBRARY):	$(OBJS)

install::
	$(INSTALL) -m 444 $(LIBRARY) $(DIST)/ldap/lib
ifdef MKSHLIB
	$(INSTALL) -m 555 $(SHARED_LIBRARY) $(DIST)/ldap/bin
endif


syntax highlighted by Code2HTML, v. 0.9.1