1 #-----------------------------------------------------------------------------
2 # Copyright (c) 1994 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 library makefile
14 #-----------------------------------------------------------------------------
18 SRCS = bind.c open.c result.c error.c compare.c search.c \
19 modify.c add.c modrdn.c delete.c abandon.c ufn.c cache.c \
20 getfilter.c regex.c sbind.c kbind.c unbind.c friendly.c cldap.c \
21 free.c disptmpl.c srchpref.c dsparse.c tmplout.c sort.c \
22 getdn.c getentry.c getattr.c getvalues.c addentry.c \
23 request.c getdxbyname.c os-ip.c url.c charset.c
24 OBJS = bind.o open.o result.o error.o compare.o search.o \
25 modify.o add.o modrdn.o delete.o abandon.o ufn.o cache.o \
26 getfilter.o regex.o sbind.o kbind.o unbind.o friendly.o cldap.o \
27 free.o disptmpl.o srchpref.o dsparse.o tmplout.o sort.o \
28 getdn.o getentry.o getattr.o getvalues.o addentry.o \
29 request.o getdxbyname.o os-ip.o url.o charset.o
33 INCLUDES= -I$(HDIR) $(KRBINCLUDEFLAG)
34 DEFINES = $(DEFS) -DFILTERFILE="\"$(LDAP_ETCDIR)/ldapfilter.conf\"" \
35 -DTEMPLATEFILE="\"$(LDAP_ETCDIR)/ldaptemplates.conf\""
37 CFLAGS = $(INCLUDES) $(DEFINES) $(ACFLAGS)
38 LIBS = -L. -L../liblber -lldap -llber $(KRBLIBFLAG) $(KRBLIBS) $(ALIBS)
40 all: libldap.a ltest ttest
43 $(AR) ruv $@ $(OBJS) version.o
44 @if [ ! -z "$(RANLIB)" ]; then \
48 $(LN) libldap/$@ ../$@
50 ltest: libldap.a test.o ../liblber/liblber.a
51 $(CC) $(ALDFLAGS) -o $@ test.o $(LIBS)
53 ttest: libldap.a tmpltest.o ../liblber/liblber.a
54 $(CC) $(ALDFLAGS) -o $@ tmpltest.o $(LIBS)
58 (u=$${USER-root} v=`$(CAT) ../../build/version` d=`$(PWD)` \
59 h=`$(HOSTNAME)` t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
60 -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
61 -e "s|%VERSION%|$${v}|" \
64 install: libldap.a ldapfilter.conf ldapfriendly ldaptemplates.conf ldapsearchprefs.conf FORCE
65 -$(MKDIR) -p $(LDAP_LIBDIR) $(LDAP_ETCDIR)
66 $(INSTALL) $(INSTALLFLAGS) -m 644 libldap.a $(LDAP_LIBDIR)
67 @if [ ! -z "$(RANLIB)" ]; then \
68 (cd /tmp; $(RANLIB) $(LDAP_LIBDIR)/libldap.a) \
70 -$(MKDIR) -p $(LDAP_ETCDIR)
71 -$(MV) $(LDAP_ETCDIR)/ldapfriendly $(LDAP_ETCDIR)/ldapfriendly-
72 $(INSTALL) $(INSTALLFLAGS) -m 644 ldapfriendly $(LDAP_ETCDIR)
73 -$(MV) $(LDAP_ETCDIR)/ldapfilter.conf $(LDAP_ETCDIR)/ldapfilter.conf-
74 $(INSTALL) $(INSTALLFLAGS) -m 644 ldapfilter.conf $(LDAP_ETCDIR)
75 -$(MV) $(LDAP_ETCDIR)/ldaptemplates.conf $(LDAP_ETCDIR)/ldaptemplates.conf-
76 $(INSTALL) $(INSTALLFLAGS) -m 644 ldaptemplates.conf $(LDAP_ETCDIR)
77 -$(MV) $(LDAP_ETCDIR)/ldapsearchprefs.conf $(LDAP_ETCDIR)/ldapsearchprefs.conf-
78 $(INSTALL) $(INSTALLFLAGS) -m 644 ldapsearchprefs.conf $(LDAP_ETCDIR)
81 $(LINT) $(INCLUDES) $(DEFINES) $(SRCS)
84 $(5LINT) $(INCLUDES) $(DEFINES) $(SRCS)
87 $(RM) libldap.a ../libldap.a ltest ttest *.o core a.out *.log version.c
90 $(MKDEP) $(INCLUDES) $(DEFINES) $(SRCS)
93 @$(LN) .src/*.[ch] .src/ldapfriendly .src/ldapfilter.conf \
94 .src/ldaptemplates.conf .src/ldapsearchprefs.conf .
96 # DO NOT DELETE THIS LINE -- mkdep uses it.
97 # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
99 bind.o: bind.c ../../include/lber.h ../../include/proto-ldap.h
100 open.o: open.c ../../include/proto-lber.h ../../include/proto-ldap.h
101 result.o: result.c ../../include/portable.h ../../include/proto-lber.h
102 result.o: ../../include/proto-ldap.h
103 error.o: error.c ../../include/lber.h ../../include/proto-ldap.h
104 compare.o: compare.c ../../include/lber.h ../../include/proto-ldap.h
105 search.o: search.c ../../include/lber.h ../../include/proto-ldap.h
106 modify.o: modify.c ../../include/lber.h ../../include/proto-ldap.h
107 add.o: add.c ../../include/lber.h ../../include/proto-ldap.h
108 modrdn.o: modrdn.c ../../include/lber.h ../../include/proto-ldap.h
109 delete.o: delete.c ../../include/lber.h ../../include/proto-ldap.h
110 abandon.o: abandon.c ../../include/lber.h ../../include/proto-ldap.h
111 ufn.o: ufn.c ../../include/lber.h ../../include/proto-ldap.h
112 cache.o: cache.c ../../include/lber.h ../../include/proto-ldap.h
113 getfilter.o: getfilter.c ../../include/lber.h ../../include/proto-ldap.h
115 sbind.o: sbind.c ../../include/lber.h ../../include/proto-ldap.h
117 unbind.o: unbind.c ../../include/proto-lber.h ../../include/proto-ldap.h
118 friendly.o: friendly.c ../../include/lber.h ../../include/proto-ldap.h
120 free.o: free.c ../../include/ldap.h
121 disptmpl.o: disptmpl.c ../../include/proto-lber.h ../../include/disptmpl.h
122 srchpref.o: srchpref.c ../../include/proto-lber.h ../../include/srchpref.h
123 dsparse.o: dsparse.c ../../include/proto-lber.h
124 tmplout.o: tmplout.c ../../include/proto-lber.h ../../include/proto-ldap.h
125 sort.o: sort.c ../../include/proto-lber.h ../../include/proto-ldap.h
126 getdn.o: getdn.c ../../include/lber.h ../../include/proto-ldap.h
127 getentry.o: getentry.c ../../include/lber.h ../../include/proto-ldap.h
128 getattr.o: getattr.c ../../include/lber.h ../../include/proto-ldap.h
129 getvalues.o: getvalues.c ../../include/lber.h ../../include/proto-ldap.h
130 addentry.o: addentry.c ../../include/lber.h ../../include/proto-ldap.h
131 request.o: request.c ../../include/portable.h ../../include/proto-lber.h
132 request.o: ../../include/proto-ldap.h
133 getdxbyname.o: getdxbyname.c
134 os-ip.o: os-ip.c ../../include/proto-lber.h ../../include/proto-ldap.h
135 url.o: url.c ../../include/lber.h ../../include/proto-ldap.h
138 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY