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