f83eba19905bfe6661a0775205f95a46e37ce9a7
[openafs.git] / src / tptserver / 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
8 srcdir=@srcdir@
9 include @TOP_OBJDIR@/src/config/Makefile.config
10 INSTALL = @INSTALL@
11 INSTALL_DATA = @INSTALL_DATA@
12 INSTALL_PROGRAM = @INSTALL_PROGRAM@
13 INSTALL_SCRIPT = @INSTALL_SCRIPT@
14 HELPER_SPLINT=@HELPER_SPLINT@
15 ENABLE_PTHREADED_UBIK=@ENABLE_PTHREADED_UBIK@
16
17 CCRULE=${MT_CC} ${CFLAGS} ${MT_CFLAGS} -c $?
18
19 RX=../rx
20 UTIL=../util
21 PTSERVER=../ptserver
22
23 RXOBJS= rx_pthread.o rxkad_errs.o
24
25 UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o \
26      volparse.o flipbase64.o softsig.o hostparse.o snprintf.o pthread_glock.o
27
28 INCLS=${TOP_INCDIR}/ubik.h \
29         ${TOP_INCDIR}/lock.h  \
30         ${TOP_INCDIR}/lwp.h \
31         ${TOP_INCDIR}/rx/rx.h \
32         ${TOP_INCDIR}/rx/xdr.h \
33         ${TOP_INCDIR}/afs/keys.h \
34         ${TOP_INCDIR}/afs/cellconfig.h \
35         ${PTSERVER}/ptserver.h \
36         ${PTSERVER}/ptclient.h \
37         ${PTSERVER}/ptuser.h \
38         ptint.h \
39         pterror.h \
40         ${PTSERVER}/map.h \
41         ${PTSERVER}/ptprototypes.h
42
43 LINCLS=${TOP_INCDIR}/ubik.h \
44         ${TOP_INCDIR}/lock.h \
45         ${TOP_INCDIR}/rx/rx.h \
46         ${TOP_INCDIR}/rx/xdr.h  \
47         ${TOP_INCDIR}/rx/rxkad.h \
48         ${TOP_INCDIR}/afs/auth.h \
49         ${TOP_INCDIR}/afs/cellconfig.h \
50         ${PTSERVER}/ptclient.h \
51         ${PTSERVER}/ptuser.h \
52         ptint.h \
53         pterror.h
54
55 LIBS=${RXOBJS} ${UTILOBJS}\
56         ${TOP_LIBDIR}/libubik_pthread.a \
57         ${TOP_LIBDIR}/libafsauthent.a \
58         ${TOP_LIBDIR}/libafsrpc.a \
59         ${TOP_LIBDIR}/libcmd.a \
60         ${TOP_LIBDIR}/libafsutil.a 
61
62 PTOBJS=ptuser.o pterror.o ptint.cs.o ptint.xdr.o
63
64 all: ptserver pts pt_util db_verify \
65         depinstall readgroup readpwd testpt
66
67 depinstall: 
68
69 #
70 # Build targets
71 #
72
73 rx_pthread.o: ${RX}/rx_pthread.c
74         ${CCRULE}
75
76 rxkad_errs.o: ../rxkad/rxkad_errs.c
77         ${CCRULE}
78
79 #
80 # get the pthreaded util stuff compiled here.  we do this instead of
81 # using the non-pthreaded libutil.a.  There probably should be a
82 # pthreaded version of this library, as we are doing with ubik itself, but...
83 #
84
85 assert.o: ${UTIL}/assert.c
86         ${CCRULE}
87
88 uuid.o: ${UTIL}/uuid.c
89         ${CCRULE}
90
91 serverLog.o: ${UTIL}/serverLog.c
92         ${CCRULE}
93
94 fileutil.o: ${UTIL}/fileutil.c
95         ${CCRULE}
96
97 volparse.o: ${UTIL}/volparse.c
98         ${CCRULE}
99
100 flipbase64.o: ${UTIL}/flipbase64.c
101         ${CCRULE}
102
103 netutils.o: ${UTIL}/netutils.c
104         ${CCRULE}
105
106 dirpath.o: ${UTIL}/dirpath.c
107         ${CCRULE}
108
109 softsig.o: ${UTIL}/softsig.c
110         ${CCRULE}
111
112 hostparse.o: ${UTIL}/hostparse.c
113         ${CCRULE}
114
115 snprintf.o: ${UTIL}/snprintf.c
116         ${CCRULE}
117
118 pthread_glock.o: ${UTIL}/pthread_glock.c
119         ${CCRULE}
120
121
122 ptserver.o: ${PTSERVER}/ptserver.c
123         ${CCRULE}
124
125 ptutils.o: ${PTSERVER}/ptutils.c
126         ${CCRULE}
127
128 ptprocs.o: ${PTSERVER}/ptprocs.c
129         ${CCRULE}
130
131 utils.o: ${PTSERVER}/utils.c
132         ${CCRULE}
133
134 map.o: ${PTSERVER}/map.c
135         ${CCRULE}
136
137 ptint.ss.o: ptint.ss.c
138         ${CCRULE}
139
140 ptint.cs.o: ptint.cs.c
141         ${CCRULE}
142
143 ptint.xdr.o: ptint.xdr.c
144         ${CCRULE}
145
146 ptint.cs.c: ${PTSERVER}/ptint.xg
147         ${RXGEN} -A -x -C -u -o $@ ${PTSERVER}/ptint.xg
148
149 ptint.ss.c: ${PTSERVER}/ptint.xg
150         ${RXGEN} -A -x -S -o $@ ${PTSERVER}/ptint.xg
151
152 ptint.xdr.c: ${PTSERVER}/ptint.xg
153         ${RXGEN} -A -x -c -o $@ ${PTSERVER}/ptint.xg
154
155 ptint.h: ${PTSERVER}/ptint.xg
156         ${RXGEN} -A -x -h -u -o $@ ${PTSERVER}/ptint.xg
157
158 ptint.cs.c: ptint.h
159 ptint.ss.c: ptint.h
160 ptint.xdr.c: ptint.h
161
162 Kptint.cs.c: ${PTSERVER}/ptint.xg Kptint.h
163         ${RXGEN} -A -x -k -C -o Kptint.cs.c ${PTSERVER}/ptint.xg
164  
165 Kptint.xdr.c: ${PTSERVER}/ptint.xg
166         ${RXGEN} -A -x -k -c -o Kptint.xdr.c ${PTSERVER}/ptint.xg
167  
168 Kptint.h: ${PTSERVER}/ptint.xg
169         ${RXGEN} -A -x -k -h -o Kptint.h ${PTSERVER}/ptint.xg
170
171 display.o: ${PTSERVER}/display.c
172         ${CCRULE}
173
174 ptserver: ptserver.o ptutils.o ptprocs.o ptint.ss.o ptint.xdr.o utils.o $(LIBS) ${TOP_LIBDIR}/libaudit.a map.o
175         ${CC} ${LDFLAGS} -o ptserver ptserver.o ptutils.o ptprocs.o ptint.ss.o ptint.xdr.o utils.o map.o $(LIBS) ${MT_LIBS} ${XLIBS} ${TOP_LIBDIR}/libaudit.a
176
177 db_verify.o: ${PTSERVER}/db_verify.c
178         ${CCRULE}
179
180 db_verify: db_verify.o pterror.o display.o $(LIBS)
181         $(CC) ${LDFLAGS} -o db_verify db_verify.o display.o pterror.o $(LIBS) ${MT_LIBS} ${XLIBS}
182
183 ptclient: ptclient.o display.o ptuser.o pterror.o ptint.cs.o ptint.xdr.o AFS_component_version_number.o $(LIBS)
184         $(CC) ${LDFLAGS} -o ptclient ptclient.o display.o $(PTOBJS) $(LIBS) ${MT_LIBS} ${XLIBS}
185
186 ptclient.o: ${PTSERVER}/ptclient.c
187         ${CCRULE}
188
189 ptuser.o: ${PTSERVER}/ptuser.c
190         ${CCRULE}
191
192 pterror.h pterror.c: ${PTSERVER}/pterror.et
193         $(RM) -f pterror.h pterror.c
194         ${COMPILE_ET} -p ${PTSERVER} pterror
195
196 pts: pts.o $(PTOBJS) ${TOP_LIBDIR}/libcmd.a $(LIBS)
197         $(CC) ${LDFLAGS} -o pts pts.o ${TOP_LIBDIR}/libcmd.a $(PTOBJS) ${LIBS} ${MT_LIBS} ${XLIBS}
198
199 pts.o: ${PTSERVER}/pts.c
200         ${CCRULE}
201
202 readgroup: readgroup.o $(PTOBJS) $(LIBS)
203         $(CC) ${CFLAGS} -o readgroup readgroup.o $(PTOBJS) ${LIBS} ${MT_LIBS} ${XLIBS}
204
205 readgroup.o: ${PTSERVER}/readgroup.c
206         ${CCRULE}
207
208 readpwd: readpwd.o $(PTOBJS) $(LIBS)
209         $(CC) ${CFLAGS} -o readpwd readpwd.o $(PTOBJS) ${LIBS} ${MT_LIBS} ${XLIBS}
210
211 readpwd.o: ${PTSERVER}/readpwd.c
212         ${CCRULE}
213
214 testpt: testpt.o $(PTOBJS) ${TOP_LIBDIR}/libcmd.a $(LIBS)
215         $(CC) ${CFLAGS} -o testpt testpt.o -lm ${TOP_LIBDIR}/libcmd.a $(PTOBJS) $(LIBS) ${MT_LIBS} ${XLIBS}
216
217 testpt.o: ${PTSERVER}/testpt.c
218         ${CCRULE}
219
220 pt_util: pt_util.o ptutils.o ubik.o utils.o map.o $(PTOBJS) $(LIBS)
221         $(CC) ${CFLAGS} -o pt_util pt_util.o ptutils.o ubik.o utils.o map.o $(PTOBJS) ${TOP_LIBDIR}/libcmd.a $(LIBS) ${MT_LIBS} ${XLIBS}
222
223 pt_util.o: ${PTSERVER}/pt_util.c
224         ${CCRULE}
225
226 ubik.o: ${PTSERVER}/ubik.c
227         ${CCRULE}
228
229 prerror.h: pterror.h
230         ${INSTALL} $? $@
231         echo '#define ERROR_TABLE_BASE_pr ERROR_TABLE_BASE_PT' >> $@
232
233 #
234 # Installation targets
235 #
236 install: ptserver pts pt_util db_verify
237         if [ "x$(ENABLE_PTHREADED_UBIK)" = "xyes" ] ; then \
238                 ${INSTALL_PROGRAM} ptserver ${DESTDIR}${afssrvlibexecdir}/ptserver; \
239                 ${INSTALL_PROGRAM} pts ${DESTDIR}${afssrvbindir}/pts; \
240                 ${INSTALL_PROGRAM} pts ${DESTDIR}${bindir}/pts; \
241                 ${INSTALL_PROGRAM} pt_util ${DESTDIR}${afssrvsbindir}/pt_util; \
242                 ${INSTALL_PROGRAM} db_verify ${DESTDIR}${afssrvsbindir}/prdb_check; \
243         fi
244
245 dest: ptserver pts pt_util db_verify
246         if [ "x$(ENABLE_PTHREADED_UBIK)" = "xyes" ] ; then \
247                 ${INSTALL_PROGRAM} ptserver ${DEST}/root.server/usr/afs/bin/ptserver; \
248                 ${INSTALL_PROGRAM} pts ${DEST}/root.server/usr/afs/bin/pts; \
249                 ${INSTALL_PROGRAM} pts ${DEST}/bin/pts; \
250                 ${INSTALL_PROGRAM} pt_util ${DEST}/root.server/usr/afs/bin/pt_util; \
251                 ${INSTALL_PROGRAM} db_verify ${DEST}/etc/prdb_check; \
252         fi
253
254 #
255 # Misc. targets
256 #
257 clean:
258         $(RM) -f *.a *.o ptserver ptint.cs.c ptint.ss.c ptclient ptint.xdr.c ptint.h \
259         pts readgroup readpwd db_verify testpt pt_util pterror.h pterror.c \
260         core AFS_component_version_number.c Kptint.cs.c Kptint.h Kptint.xdr.c
261
262 include ../config/Makefile.version