]> git.sur5r.net Git - openldap/blob - servers/ldapd/Make-template
merged with autoconf branch
[openldap] / servers / ldapd / Make-template
1 #-----------------------------------------------------------------------------
2 # Copyright (c) 1990 Regents of the University of Michigan.
3 # All rights reserved.
4 #
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.
11 #
12 #       LDAP server daemon makefile
13 #
14 #-----------------------------------------------------------------------------
15 LDAPSRC = ../..
16 HDIR    = $(LDAPSRC)/include
17 LDIR    = $(LDAPSRC)/libraries
18 VERSIONFILE = $(LDAPSRC)/build/version
19
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 \
26         certificate.o
27
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)
33
34 all:    FORCE
35         @if [ "$(HAVEISODE)" = "yes" ]; then \
36             $(MAKE) $(MFLAGS) CC="$(CC)" ldapd; \
37         else \
38             echo "uncomment the HAVEISODE=yes line in the Make-common file to build ldapd"; \
39         fi
40
41
42 ldapd:  version.o
43         $(CC) $(ALDFLAGS) -o $@ $(OBJS) version.o $(LDFLAGS) $(LIBS)
44
45 sldapd: version.o
46         $(CC) $(ALDFLAGS) -static -o $@ $(OBJS) version.o $(LDFLAGS) $(LIBS) -lresolv
47
48 version.c: $(OBJS) $(LDIR)/liblber/liblber.a
49         $(RM) $@
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}|" \
54         < Version.c > $@)
55
56 request.o:      LDAP-types.h
57
58 LDAP_tables.c:  ldap.py
59         @if [ ! -z "$(PEPSY)" ]; then \
60             $(PEPSY) -A ldap.py; \
61         else \
62             touch LDAP_tables.c LDAP-types.h; \
63         fi
64
65 LDAP-types.h: LDAP_tables.c
66
67 install:        FORCE
68         @if [ "$(HAVEISODE)" = "yes" ]; then \
69             $(MAKE) $(MFLAGS) CC="$(CC)" install-ldapd; \
70         else \
71             echo "uncomment the HAVEISODE=yes line in the Make-common file to build and install ldapd"; \
72         fi
73
74 install-ldapd: $(LDAP_LIBEXECDIR) $(LDAP_LIBEXECDIR)/ldapd
75
76 $(LDAP_LIBEXECDIR)/ldapd:       ldapd
77         $(INSTALL) $(INSTALLFLAGS) -m 755 ldapd $(LDAP_LIBEXECDIR)
78
79 lint:   FORCE
80         $(LINT) $(INCLUDES) $(DEFINES) $(SRCS)
81
82 5lint:  FORCE
83         $(5LINT) $(INCLUDES) $(DEFINES) $(SRCS)
84
85 clean:  FORCE
86         $(RM) ldapd sldapd *.o core a.out version.c LDAP*
87
88 depend: FORCE
89         @if [ ! -z "$(HAVEISODE)" ]; then \
90             $(MKDEP) $(INCLUDES) $(DEFINES) $(SRCS); \
91         else \
92             echo "uncomment the HAVEISODE=yes line in the Make-common file to build ldapd"; \
93         fi
94
95 links:
96         @$(LN) .src/*.py .src/*.[ch] .
97