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