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