ptserver: Use libtool to build a pthreaded libprot
[openafs.git] / src / ptserver / Makefile.in
1 # Copyright 2000, International Business Machines Corporation and others.
2 # All Rights Reserved.
3
4 # This software has been released under the terms of the IBM Public
5 # License.  For details, see the LICENSE file in the top-level source
6 # directory or online at http://www.openafs.org/dl/license10.html
7 srcdir=@srcdir@
8 include @TOP_OBJDIR@/src/config/Makefile.config
9 include @TOP_OBJDIR@/src/config/Makefile.libtool
10 include @TOP_OBJDIR@/src/config/Makefile.lwp
11
12 ENABLE_PTHREADED_UBIK=@ENABLE_PTHREADED_UBIK@
13
14 INCLS=${TOP_INCDIR}/ubik.h \
15         ${TOP_INCDIR}/lock.h  \
16         ${TOP_INCDIR}/lwp.h \
17         ${TOP_INCDIR}/rx/rx.h \
18         ${TOP_INCDIR}/rx/xdr.h \
19         ${TOP_INCDIR}/afs/keys.h \
20         ${TOP_INCDIR}/afs/cellconfig.h \
21         ptserver.h ptclient.h ptuser.h ptint.h pterror.h map.h ptprototypes.h
22
23 LINCLS=${TOP_INCDIR}/ubik.h \
24         ${TOP_INCDIR}/lock.h \
25         ${TOP_INCDIR}/rx/rx.h \
26         ${TOP_INCDIR}/rx/xdr.h  \
27         ${TOP_INCDIR}/rx/rxkad.h \
28         ${TOP_INCDIR}/afs/auth.h \
29         ${TOP_INCDIR}/afs/cellconfig.h \
30         ptclient.h ptuser.h ptint.h pterror.h
31
32 LIBS=   ${TOP_LIBDIR}/libubik.a \
33         ${TOP_LIBDIR}/libauth.a \
34         ${TOP_LIBDIR}/librxkad.a \
35         ${TOP_LIBDIR}/librxstat.a \
36         ${TOP_LIBDIR}/librx.a \
37         ${TOP_LIBDIR}/liblwp.a \
38         ${TOP_LIBDIR}/libcmd.a \
39         ${TOP_LIBDIR}/libafscom_err.a \
40         ${TOP_LIBDIR}/libsys.a \
41         ${TOP_LIBDIR}/libaudit.a \
42         ${TOP_LIBDIR}/libafsutil.a \
43         ${TOP_LIBDIR}/libopr.a \
44         ${TOP_LIBDIR}/libafshcrypto_lwp.a
45
46 LT_objs = ptuser.lo pterror.lo ptint.cs.lo ptint.xdr.lo display.lo
47
48 LT_deps = $(top_builddir)/src/opr/liboafs_opr.la \
49           $(top_builddir)/src/rx/liboafs_rx.la \
50           $(top_builddir)/src/ubik/liboafs_ubik.la \
51           $(top_builddir)/src/auth/liboafs_auth.la
52 LT_libs =
53
54 all: ptserver pts pt_util db_verify liboafs_prot.la ${TOP_LIBDIR}/libprot.a \
55         depinstall readgroup readpwd testpt ptclient
56
57 generated: \
58         pterror.h pterror.c \
59         ptint.cs.c ptint.ss.c ptint.xdr.c ptint.h
60
61 depinstall: \
62         ptint.cs.c ptint.xdr.c \
63         ${TOP_INCDIR}/afs/prclient.h \
64         ${TOP_INCDIR}/afs/prerror.h \
65         ${TOP_INCDIR}/afs/print.h \
66         ${TOP_INCDIR}/afs/prserver.h \
67         ${TOP_INCDIR}/afs/ptclient.h \
68         ${TOP_INCDIR}/afs/ptuser.h \
69         ${TOP_INCDIR}/afs/pterror.h \
70         ${TOP_INCDIR}/afs/ptint.h \
71         ${TOP_INCDIR}/afs/ptserver.h
72
73 ${TOP_LIBDIR}/libprot.a: libprot.a
74         ${INSTALL_DATA} $? $@
75
76 ${TOP_INCDIR}/afs/prclient.h: ptclient.h
77         ${INSTALL_DATA} $? $@
78
79 ${TOP_INCDIR}/afs/prerror.h: pterror.h
80         ${INSTALL_DATA} $? $@
81
82 ${TOP_INCDIR}/afs/print.h: ptint.h
83         ${INSTALL_DATA} $? $@
84
85 ${TOP_INCDIR}/afs/prserver.h: ptserver.h
86         ${INSTALL_DATA} $? $@
87
88 ${TOP_INCDIR}/afs/ptclient.h: ptclient.h
89         ${INSTALL_DATA} $? $@
90
91 ${TOP_INCDIR}/afs/ptuser.h: ptuser.h
92         ${INSTALL_DATA} $? $@
93
94 ${TOP_INCDIR}/afs/pterror.h: pterror.h
95         ${INSTALL_DATA} $? $@
96
97 ${TOP_INCDIR}/afs/ptint.h: ptint.h
98         ${INSTALL_DATA} $? $@
99
100 ${TOP_INCDIR}/afs/ptserver.h: ptserver.h
101         ${INSTALL_DATA} $? $@
102
103 #
104 # Build targets
105 #
106 ptserver: ptserver.o ptutils.o ptprocs.o ptint.ss.o ptint.xdr.o utils.o $(LIBS) map.o
107         $(AFS_LDRULE) ptserver.o ptutils.o ptprocs.o ptint.ss.o ptint.xdr.o \
108                 utils.o map.o $(LIBS) $(LIB_roken) ${XLIBS}
109
110 ptserver.o: ptserver.c ${INCLS} AFS_component_version_number.c
111
112 # When supergroups is enabled, some parts of ptserver cast between
113 # incompatible structs.
114 CFLAGS_ptutils.o = @CFLAGS_NOSTRICT@
115 CFLAGS_ptprocs.o = @CFLAGS_NOSTRICT@
116
117 ptutils.o: ptutils.c ${INCLS}
118 ptprocs.o: ptprocs.c ${INCLS}
119 utils.o: utils.c ${INCLS} 
120 map.o: map.c ${INCLS}
121 ptint.ss.o: ptint.ss.c ptint.xdr.c ptint.xg
122 ptint.cs.o: ptint.cs.c ptint.xdr.c ptint.xg
123 ptint.xdr.o: ptint.xdr.c ptint.h ptint.xg
124
125 ptint.cs.c: ptint.xg
126         ${RXGEN} -A -x -C -u -o $@ ${srcdir}/ptint.xg
127
128 ptint.ss.c: ptint.xg
129         ${RXGEN} -A -x -S -o $@ ${srcdir}/ptint.xg
130
131 ptint.xdr.c: ptint.xg
132         ${RXGEN} -A -x -c -o $@ ${srcdir}/ptint.xg
133
134 ptint.h: ptint.xg
135         ${RXGEN} -A -x -h -u -o $@ ${srcdir}/ptint.xg
136
137 ptint.cs.c: ptint.h
138 ptint.ss.c: ptint.h
139 ptint.xdr.c: ptint.h
140
141 Kptint.cs.c: ptint.xg Kptint.h
142         ${RXGEN} -A -x -k -C -o Kptint.cs.c ${srcdir}/ptint.xg
143
144 Kptint.xdr.c: ptint.xg
145         ${RXGEN} -A -x -k -c -o Kptint.xdr.c ${srcdir}/ptint.xg
146
147 Kptint.h: ptint.xg
148         ${RXGEN} -A -x -k -h -o Kptint.h ${srcdir}/ptint.xg
149
150 db_verify.o: db_verify.c ${INCLS} AFS_component_version_number.c
151
152 db_verify: db_verify.o libprot.a $(LIBS)
153         $(AFS_LDRULE) db_verify.o libprot.a \
154                 $(LIBS) $(LIB_roken) ${XLIBS}
155
156 ptclient: ptclient.o libprot.a $(LIBS)
157         $(AFS_LDRULE) ptclient.o libprot.a \
158                 $(LIBS) $(LIB_roken) ${XLIBS}
159
160 ptclient.o: ptclient.c ${INCLS} AFS_component_version_number.c
161
162 pterror.h pterror.c: pterror.et
163         $(RM) -f pterror.h pterror.c
164         ${COMPILE_ET} -p ${srcdir} pterror
165
166 display.lo: $(INCLS)
167 ptuser.lo: $(LINCLS)
168
169 liboafs_prot.la: liboafs_prot.la.sym $(LT_objs) $(LT_deps)
170         $(LT_LDLIB_shlib) $(LT_objs) $(LT_deps) $(LT_libs)
171
172 libprot.a: $(LT_objs)
173         $(LT_LDLIB_lwp) $(LT_objs)
174
175 pts: pts.o libprot.a ${TOP_LIBDIR}/libcmd.a $(LIBS)
176         $(AFS_LDRULE) pts.o ${TOP_LIBDIR}/libcmd.a libprot.a \
177                 ${LIBS} $(LIB_roken) ${XLIBS}
178
179 pts.o: pts.c ${LINCLS} ${TOP_INCDIR}/afs/cmd.h AFS_component_version_number.c
180
181 readgroup: readgroup.o libprot.a $(LIBS)
182         $(AFS_LDRULE) readgroup.o libprot.a \
183                 ${LIBS} $(LIB_roken) ${XLIBS}
184
185 readgroup.o: readgroup.c ${LINCLS} AFS_component_version_number.c
186
187 readpwd: readpwd.o libprot.a $(LIBS)
188         $(AFS_LDRULE) readpwd.o libprot.a \
189                 ${LIBS} $(LIB_roken) ${XLIBS}
190
191 readpwd.o: readpwd.c ${LINCLS} AFS_component_version_number.c
192
193 testpt: testpt.o libprot.a ${TOP_LIBDIR}/libcmd.a $(LIBS)
194         case "$(SYS_NAME)" in \
195         *_darwin_12 ) \
196                 $(AFS_LDRULE_NOQ) testpt.o ${TOP_LIBDIR}/libcmd.a \
197                         libprot.a $(LIBS) $(LIB_roken) ;; \
198         * ) \
199                 $(AFS_LDRULE_NOQ) testpt.o -lm ${TOP_LIBDIR}/libcmd.a \
200                         libprot.a $(LIBS) $(LIB_roken) ${XLIBS} ;; \
201         esac
202
203 testpt.o: testpt.c ${INCLS} ${TOP_INCDIR}/afs/cmd.h AFS_component_version_number.c
204
205 pt_util: pt_util.o ptutils.o ubik.o utils.o map.o libprot.a $(LIBS)
206         $(AFS_LDRULE) pt_util.o ptutils.o ubik.o utils.o map.o libprot.a \
207                 ${TOP_LIBDIR}/libcmd.a $(LIBS) $(LIB_roken) ${XLIBS}
208
209 ubik.o: ubik.c ${INCLS}
210
211 prerror.h: pterror.h
212         ${INSTALL_DATA} $? $@
213         echo '#define ERROR_TABLE_BASE_pr ERROR_TABLE_BASE_PT' >> $@
214
215 #
216 # Installation targets
217 #
218 install: ptserver pts pt_util db_verify libprot.a ptclient.h pterror.h \
219                 ptint.h ptserver.h
220         ${INSTALL} -d ${DESTDIR}${afssrvlibexecdir}
221         ${INSTALL} -d ${DESTDIR}${afssrvbindir}
222         ${INSTALL} -d ${DESTDIR}${afssrvsbindir}
223         ${INSTALL} -d ${DESTDIR}${bindir}
224         ${INSTALL} -d ${DESTDIR}${libdir}/afs
225         ${INSTALL} -d ${DESTDIR}${includedir}/afs
226         if [ "x$(ENABLE_PTHREADED_UBIK)" != "xyes" ] ; then \
227                 ${INSTALL_PROGRAM} ptserver ${DESTDIR}${afssrvlibexecdir}/ptserver; \
228                 ${INSTALL_PROGRAM} pts ${DESTDIR}${afssrvbindir}/pts; \
229                 ${INSTALL_PROGRAM} pts ${DESTDIR}${bindir}/pts; \
230                 ${INSTALL_PROGRAM} pt_util ${DESTDIR}${afssrvsbindir}/pt_util; \
231                 ${INSTALL_PROGRAM} db_verify ${DESTDIR}${afssrvsbindir}/prdb_check; \
232         fi
233         ${INSTALL_DATA} libprot.a ${DESTDIR}${libdir}/afs/libprot.a
234         ${INSTALL_DATA} ${srcdir}/ptclient.h ${DESTDIR}${includedir}/afs/prclient.h
235         ${INSTALL_DATA} pterror.h ${DESTDIR}${includedir}/afs/prerror.h
236         ${INSTALL_DATA} ptint.h ${DESTDIR}${includedir}/afs/print.h
237         ${INSTALL_DATA} ${srcdir}/ptserver.h ${DESTDIR}${includedir}/afs/prserver.h
238         ${INSTALL_DATA} ${srcdir}/ptclient.h ${DESTDIR}${includedir}/afs/ptclient.h
239         ${INSTALL_DATA} ${srcdir}/ptuser.h ${DESTDIR}${includedir}/afs/ptuser.h
240         ${INSTALL_DATA} pterror.h ${DESTDIR}${includedir}/afs/pterror.h
241         ${INSTALL_DATA} ptint.h ${DESTDIR}${includedir}/afs/ptint.h
242         ${INSTALL_DATA} ${srcdir}/ptserver.h ${DESTDIR}${includedir}/afs/ptserver.h
243
244 dest: ptserver pts pt_util db_verify libprot.a ptclient.h pterror.h \
245                 ptint.h ptserver.h
246         ${INSTALL} -d ${DEST}/root.server/usr/afs/bin
247         ${INSTALL} -d ${DEST}/bin
248         ${INSTALL} -d ${DEST}/etc
249         ${INSTALL} -d ${DEST}/lib/afs
250         ${INSTALL} -d ${DEST}/include/afs
251         if [ "x$(ENABLE_PTHREADED_UBIK)" != "xyes" ] ; then \
252                 ${INSTALL_PROGRAM} ptserver ${DEST}/root.server/usr/afs/bin/ptserver; \
253                 ${INSTALL_PROGRAM} pts ${DEST}/root.server/usr/afs/bin/pts; \
254                 ${INSTALL_PROGRAM} pts ${DEST}/bin/pts; \
255                 ${INSTALL_PROGRAM} pt_util ${DEST}/root.server/usr/afs/bin/pt_util; \
256                 ${INSTALL_PROGRAM} db_verify ${DEST}/etc/prdb_check; \
257         fi;
258         ${INSTALL_DATA} libprot.a ${DEST}/lib/afs/libprot.a
259         ${INSTALL_DATA} ${srcdir}/ptclient.h ${DEST}/include/afs/prclient.h
260         ${INSTALL_DATA} pterror.h ${DEST}/include/afs/prerror.h
261         ${INSTALL_DATA} ptint.h ${DEST}/include/afs/print.h
262         ${INSTALL_DATA} ${srcdir}/ptserver.h ${DEST}/include/afs/prserver.h
263         ${INSTALL_DATA} ${srcdir}/ptclient.h ${DEST}/include/afs/ptclient.h
264         ${INSTALL_DATA} ${srcdir}/ptuser.h ${DEST}/include/afs/ptuser.h
265         ${INSTALL_DATA} pterror.h ${DEST}/include/afs/pterror.h
266         ${INSTALL_DATA} ptint.h ${DEST}/include/afs/ptint.h
267         ${INSTALL_DATA} ${srcdir}/ptserver.h ${DEST}/include/afs/ptserver.h
268
269 #
270 # Misc. targets
271 #
272 clean:
273         $(LT_CLEAN)
274         $(RM) -f *.a *.o ptserver ptint.cs.c ptint.ss.c ptclient ptint.xdr.c ptint.h \
275         libprot.a pts readgroup readpwd db_verify testpt pt_util pterror.h pterror.c \
276         core AFS_component_version_number.c Kptint.cs.c Kptint.h Kptint.xdr.c
277
278 include ../config/Makefile.version