Make-template 7.6 KB
Newer Older
Kurt Zeilenga's avatar
Kurt Zeilenga committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#-----------------------------------------------------------------------------
# Copyright (c) 1995 Regents of the University of Michigan.
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that this notice is preserved and that due credit is given
# to the University of Michigan at Ann Arbor. The name of the University
# may not be used to endorse or promote products derived from this
# software without specific prior written permission. This software
# is provided ``as is'' without express or implied warranty.
#
#       Stand alone LDAP server tools makefile
#
#-----------------------------------------------------------------------------
LDAPSRC	= ../../..
HDIR	= $(LDAPSRC)/include
LDIR	= $(LDAPSRC)/libraries
VERSIONFILE = $(LDAPSRC)/build/version

EDB2LDIFSRCS	= edb2ldif.c ldapsyntax.c
EDB2LDIFOBJS	= edb2ldif.o ldapsyntax.o ../strdup.o

OBJS2	= ../config.o ../ch_malloc.o ../backend.o ../charray.o \
		../aclparse.o ../schema.o ../result.o ../filterentry.o \
		../acl.o ../phonetic.o ../attr.o ../value.o ../entry.o \
		../dn.o ../filter.o ../str2filter.o ../ava.o ../init.o \
		../schemaparse.o ../regex.o ../strdup.o

INCLUDES= -I. -I$(HDIR) $(EXINCLUDES)
30
DEFINES = $(DEFS) $(LDAP_CRYPT) $(SERVERDEFS) $(THREADS)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
31
32
33
34
CFLAGS	= $(INCLUDES) $(DEFINES) $(ACFLAGS)
LDFLAGS	= -L$(LDIR) $(EXLDFLAGS)
LIBS	= -lldif -lldap -llber -lldbm -lavl $(LDBMLIB) $(EXLIBS) $(ALIBS)
LIBS2	= -lldif -lldbm -lavl $(LDBMLIB) -llber $(KRBLIBFLAG) $(KRBLIBS) \
35
		-llthread $(THREADSLIB) $(ALIBS) $(LDAP_CRYPT_LIB)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180

all:	build-edb2ldif ldif2index ldif2ldbm ldbmcat ldif2id2entry \
		ldif2id2children centipede ldbmtest ldif

build-edb2ldif:	FORCE
	@if [ "$(HAVEISODE)" = "yes" ]; then \
	    $(MAKE) $(MFLAGS) CC=$(CC) EXINCLUDES="$(ISODEINCLUDEFLAG)" \
		EXLDFLAGS="$(ISODELIBFLAG)" EXLIBS="$(ISODELIBS)" edb2ldif; \
        else \
            echo "uncomment the HAVEISODE=yes line in the Make-common file to build edb2ldif"; \
        fi

edb2ldif:	edb2-vers.o
	$(CC) $(ALDFLAGS) -o $@ $(EDB2LDIFOBJS) edb2-vers.o \
		$(LDFLAGS) $(LIBS)

edb2-vers.c: $(EDB2LDIFOBJS)
	$(RM) $@
	(u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \
	t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
	-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
	-e "s|%VERSION%|$${v}|" \
	< Vers-edb2.c > $@)

build-chlog2replog: FORCE
	@if [ "$(HAVEISODE)" = "yes" ]; then \
	    $(MAKE) $(MFLAGS) CC=$(CC) EXINCLUDES="$(ISODEINCLUDEFLAG)" \
		EXLDFLAGS="$(ISODELIBFLAG)" EXLIBS="$(ISODELIBS)" chlog2replog; \
        else \
            echo "uncomment the HAVEISODE=yes line in the Make-common file to build chlog2replog"; \
        fi

chlog2replog: chlog2replog.o ../lock.o ../ch_malloc.o
	$(CC) $(ALDFLAGS) -o $@ chlog2replog.o ../lock.o ../ch_malloc.o \
	$(LDFLAGS) $(LIBS)

ldif2index:	ldif2index.o ../libbackends.a $(OBJS2)
	$(CC) $(ALDFLAGS) -o $@ ldif2index.o $(OBJS2) \
		../libbackends.a $(LDFLAGS) $(LIBS2)

ldif2ldbm:	ldif2ldbm.sed.o ../libbackends.a $(OBJS2)
	$(CC) $(ALDFLAGS) -o $@ ldif2ldbm.sed.o $(OBJS2) \
		../libbackends.a $(LDFLAGS) $(LIBS2)

ldif2ldbm.sed.c: ldif2ldbm.c
	$(SED) -e 's;%ETCDIR%;$(RUNTIMEETCDIR);' ldif2ldbm.c > ldif2ldbm.sed.c

ldif2id2entry:	ldif2id2entry.o ../libbackends.a $(OBJS2)
	$(CC) $(ALDFLAGS) -o $@ ldif2id2entry.o $(OBJS2) \
		../libbackends.a $(LDFLAGS) $(LIBS2)

ldif2id2children:	ldif2id2children.o ../libbackends.a $(OBJS2)
	$(CC) $(ALDFLAGS) -o $@ ldif2id2children.o $(OBJS2) \
		../libbackends.a $(LDFLAGS) $(LIBS2)

ldbmcat:	ldbmcat.o
	$(CC) $(ALDFLAGS) -o $@ ldbmcat.o $(LDFLAGS) $(LIBS)

ldif:		ldif.o
	$(CC) $(ALDFLAGS) -o $@ ldif.o $(LDFLAGS) $(LIBS) $(LIBS2)

centipede:	centipede.o 
	$(CC) $(ALDFLAGS) -o $@ centipede.o $(LDFLAGS) $(LIBS) \
		$(KRBLIBFLAG) $(KRBLIBS)

sizecount:	sizecount.o ../phonetic.o ../ch_malloc.o
	$(CC) $(ALDFLAGS) -o $@ sizecount.o ../phonetic.o ../ch_malloc.o \
		$(LDFLAGS) $(LIBS) $(KRBLIBFLAG) $(KRBLIBS)

ldbmtest:	ldbmtest.o ../libbackends.a $(OBJS2)
	$(CC) $(ALDFLAGS) -o ldbmtest ldbmtest.o $(OBJS2) \
		../libbackends.a $(LDFLAGS) $(LIBS2)

install: $(ETCDIR) $(ETCDIR)/edb2ldif $(ETCDIR)/ldif2ldbm \
	$(ETCDIR)/ldif2index $(ETCDIR)/ldif2id2entry \
	$(ETCDIR)/ldif2id2children $(ETCDIR)/ldbmcat \
	$(ETCDIR)/centipede $(ETCDIR)/ldbmtest \
	$(ETCDIR)/ldif

$(ETCDIR)/edb2ldif:	build-edb2ldif
	@if [ "$(HAVEISODE)" = "yes" ]; then \
		$(INSTALL) $(INSTALLFLAGS) -m 755 edb2ldif $(ETCDIR); \
	else \
		exit 0; \
	fi

$(ETCDIR)/chlog2replog:	build-chlog2replog
	@if [ "$(HAVEISODE)" = "yes" ]; then \
		$(INSTALL) $(INSTALLFLAGS) -m 755 chlog2replog $(ETCDIR); \
	else \
		exit 0; \
	fi

$(ETCDIR)/ldif2ldbm:	ldif2ldbm
	$(INSTALL) $(INSTALLFLAGS) -m 755 ldif2ldbm $(ETCDIR)

$(ETCDIR)/ldif2index:	ldif2index
	$(INSTALL) $(INSTALLFLAGS) -m 755 ldif2index $(ETCDIR)

$(ETCDIR)/ldif2id2entry:	ldif2id2entry
	$(INSTALL) $(INSTALLFLAGS) -m 755 ldif2id2entry $(ETCDIR)

$(ETCDIR)/ldif2id2children:	ldif2id2children
	$(INSTALL) $(INSTALLFLAGS) -m 755 ldif2id2children $(ETCDIR)

$(ETCDIR)/ldbmcat:	ldbmcat
	$(INSTALL) $(INSTALLFLAGS) -m 755 ldbmcat $(ETCDIR)

$(ETCDIR)/ldif:	ldif
	$(INSTALL) $(INSTALLFLAGS) -m 755 ldif $(ETCDIR)

$(ETCDIR)/centipede:	centipede
	$(INSTALL) $(INSTALLFLAGS) -m 755 centipede $(ETCDIR)

$(ETCDIR)/ldbmtest:	ldbmtest
	$(INSTALL) $(INSTALLFLAGS) -m 755 ldbmtest $(ETCDIR)

lint:	FORCE
	$(LINT) $(INCLUDES) $(DEFINES) $(SRCS)

5lint:	FORCE
	$(5LINT) $(INCLUDES) $(DEFINES) $(SRCS)

clean:	FORCE
	@echo "making clean in `$(PWD)`"
	$(RM) edb2ldif ldif2index *.o core a.out edb2-vers.c \
		ldif2ldbm ldif2id2entry ldif2id2children ldbmcat ldif \
		centipede chlog2replog sizecount ldif2ldbm.sed.c ldbmtest

depend:	ldif2ldbm.sed.c FORCE
	@if [ ! -z "$(HAVEISODE)" ]; then \
	    DEPENDEXTRAS="$(ISODEINCLUDEFLAG) chlog2replog.c $(EDB2LDIFSRCS)"; \
	fi; \
	$(MKDEP) $(INCLUDES) $(DEFINES) $$DEPENDEXTRAS ldif2index.c \
	    ldif2ldbm.c ldif2id2entry.c ldif2id2children.c ldbmcat.c \
	    centipede.c sizecount.c ldif2ldbm.sed.c ldbmtest.c ldif.c

links:
	@echo "making links in `$(PWD)`"
	@$(LN) .src/*.[ch] .


# DO NOT DELETE THIS LINE -- mkdep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.

181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
ldif2index.o: ldif2index.c ../../../include/avl.h ../../../include/proto-lber.h
ldif2index.o: ../../../include/proto-ldap.h ../../../include/ldif.h
ldif2ldbm.o: ldif2ldbm.c ../../../include/proto-lber.h
ldif2ldbm.o: ../../../include/proto-ldap.h ../../../include/ldif.h
ldif2ldbm.o: ../../../include/ldbm.h
ldif2id2entry.o: ldif2id2entry.c ../../../include/avl.h
ldif2id2entry.o: ../../../include/proto-lber.h ../../../include/proto-ldap.h
ldif2id2entry.o: ../../../include/ldif.h ../../../include/ldbm.h
ldif2id2children.o: ldif2id2children.c ../../../include/avl.h
ldif2id2children.o: ../../../include/proto-lber.h ../../../include/proto-ldap.h
ldif2id2children.o: ../../../include/ldif.h ../../../include/ldbm.h
ldbmcat.o: ldbmcat.c ../../../include/proto-lber.h
ldbmcat.o: ../../../include/proto-ldap.h ../../../include/ldif.h
centipede.o: centipede.c ../../../include/proto-lber.h
centipede.o: ../../../include/proto-ldap.h ../../../include/ldbm.h
sizecount.o: sizecount.c ../../../include/lber.h ../../../include/ldap.h
sizecount.o: ../../../include/proto-ldap.h
ldif2ldbm.sed.o: ldif2ldbm.sed.c ../../../include/avl.h
ldif2ldbm.sed.o: ../../../include/proto-lber.h ../../../include/proto-ldap.h
ldif2ldbm.sed.o: ../../../include/ldif.h ../../../include/ldbm.h
ldbmtest.o: ldbmtest.c ../../../include/ldapconfig.h ../../../include/avl.h
ldbmtest.o: ../../../include/proto-lber.h ../../../include/proto-ldap.h
ldbmtest.o: ../../../include/ldif.h ../../../include/ldbm.h
ldbmtest.o: ../back-ldbm/proto-back-ldbm.h
ldif.o: ldif.c ../../../include/proto-lber.h ../../../include/proto-ldap.h
Kurt Zeilenga's avatar
Kurt Zeilenga committed
206
207

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY