]> git.sur5r.net Git - openldap/blob - servers/ldapd/Make-template
Resync with HEAD
[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: $(ETCDIR) $(ETCDIR)/ldapd
75
76 $(ETCDIR)/ldapd:        ldapd
77         $(INSTALL) $(INSTALLFLAGS) -m 755 ldapd $(ETCDIR)
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 # DO NOT DELETE THIS LINE -- mkdep uses it.
98 # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
99
100 main.o: main.c ../../include/portable.h ../../include/lber.h
101 main.o: ../../include/ldap.h common.h
102 detach.o: detach.c ../../include/portable.h
103 setproctitle.o: setproctitle.c
104 request.o: request.c ../../include/lber.h ../../include/ldap.h common.h
105 bind.o: bind.c ../../include/lber.h ../../include/ldap.h common.h
106 result.o: result.c ../../include/lber.h ../../include/ldap.h common.h
107 error.o: error.c ../../include/lber.h ../../include/ldap.h
108 search.o: search.c ../../include/lber.h ../../include/ldap.h common.h
109 util.o: util.c ../../include/lber.h ../../include/ldap.h common.h
110 compare.o: compare.c ../../include/lber.h ../../include/ldap.h common.h
111 message.o: message.c ../../include/lber.h ../../include/ldap.h common.h
112 add.o: add.c ../../include/lber.h ../../include/ldap.h common.h
113 delete.o: delete.c ../../include/lber.h ../../include/ldap.h common.h
114 modrdn.o: modrdn.c ../../include/lber.h ../../include/ldap.h common.h
115 modify.o: modify.c ../../include/lber.h ../../include/ldap.h common.h
116 abandon.o: abandon.c ../../include/lber.h ../../include/ldap.h common.h
117 syntax.o: syntax.c ../../include/lber.h ../../include/ldap.h common.h
118 association.o: association.c ../../include/lber.h ../../include/ldap.h common.h
119 kerberos.o: kerberos.c ../../include/lber.h ../../include/ldap.h common.h
120 certificate.o: certificate.c ../../include/lber.h ../../include/ldap.h common.h
121
122 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY