1 #-----------------------------------------------------------------------------
2 # Copyright (c) 1990 Regents of the University of Michigan.
5 # Redistribution and use in source and binary forms are permitted
6 # provided that this notice is preserved and that due credit is given
7 # to the University of Michigan at Ann Arbor. The name of the University
8 # may not be used to endorse or promote products derived from this
9 # software without specific prior written permission. This software
10 # is provided ``as is'' without express or implied warranty.
12 # LDAP server daemon makefile
14 #-----------------------------------------------------------------------------
16 HDIR = $(LDAPSRC)/include
17 LDIR = $(LDAPSRC)/libraries
18 VERSIONFILE = $(LDAPSRC)/build/version
20 SRCS = main.c detach.c setproctitle.c request.c bind.c result.c error.c \
21 search.c util.c compare.c message.c add.c delete.c modrdn.c modify.c \
22 abandon.c syntax.c association.c kerberos.c certificate.c
23 OBJS = main.o detach.o setproctitle.o request.o bind.o result.o error.o \
24 search.o util.o compare.o message.o add.o delete.o modrdn.o modify.o \
25 abandon.o syntax.o association.o kerberos.o LDAP_tables.o \
28 INCLUDES= -I. -I$(HDIR) $(ISODEINCLUDEFLAG) $(KRBINCLUDEFLAG)
29 DEFINES = $(DEFS) $(SERVERDEFS)
30 CFLAGS = $(INCLUDES) $(DEFINES) $(ACFLAGS)
31 LDFLAGS = -L$(LDIR) $(ISODELIBFLAG) $(KRBLIBFLAG)
32 LIBS = -llber $(ISODELIBS) $(KRBLIBS) $(ALIBS)
35 @if [ "$(HAVEISODE)" = "yes" ]; then \
36 $(MAKE) $(MFLAGS) CC=$(CC) ldapd; \
38 echo "uncomment the HAVEISODE=yes line in the Make-common file to build ldapd"; \
43 $(CC) $(ALDFLAGS) -o $@ $(OBJS) version.o $(LDFLAGS) $(LIBS)
46 $(CC) $(ALDFLAGS) -static -o $@ $(OBJS) version.o $(LDFLAGS) $(LIBS) -lresolv
48 version.c: $(OBJS) $(LDIR)/liblber/liblber.a
50 (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \
51 t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
52 -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
53 -e "s|%VERSION%|$${v}|" \
56 request.o: LDAP-types.h
58 LDAP_tables.c: ldap.py
59 @if [ ! -z "$(PEPSY)" ]; then \
60 $(PEPSY) -A ldap.py; \
62 touch LDAP_tables.c LDAP-types.h; \
65 LDAP-types.h: LDAP_tables.c
68 @if [ "$(HAVEISODE)" = "yes" ]; then \
69 $(MAKE) $(MFLAGS) CC=$(CC) install-ldapd; \
71 echo "uncomment the HAVEISODE=yes line in the Make-common file to build and install ldapd"; \
74 install-ldapd: $(LDAP_LIBEXECDIR) $(LDAP_LIBEXECDIR)/ldapd
76 $(LDAP_LIBEXECDIR)/ldapd: ldapd
77 $(INSTALL) $(INSTALLFLAGS) -m 755 ldapd $(LDAP_LIBEXECDIR)
80 $(LINT) $(INCLUDES) $(DEFINES) $(SRCS)
83 $(5LINT) $(INCLUDES) $(DEFINES) $(SRCS)
86 $(RM) ldapd sldapd *.o core a.out version.c LDAP*
89 @if [ ! -z "$(HAVEISODE)" ]; then \
90 $(MKDEP) $(INCLUDES) $(DEFINES) $(SRCS); \
92 echo "uncomment the HAVEISODE=yes line in the Make-common file to build ldapd"; \
96 @$(LN) .src/*.py .src/*.[ch] .