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