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