darwin-x86-and-leopard-20060309
[openafs.git] / src / sys / Makefile.in
1 # API version. When something changes, increment as appropriate. 
2 # Ignore at your own risk.
3 LIBAFSSETPAGMAJOR=1
4 LIBAFSSETPAGMINOR=0
5
6 # Copyright 2000, International Business Machines Corporation and others.
7 # All Rights Reserved.
8
9 # This software has been released under the terms of the IBM Public
10 # License.  For details, see the LICENSE file in the top-level source
11 # directory or online at http://www.openafs.org/dl/license10.html
12 #
13 # Portions Copyright (c) 2003 Apple Computer, Inc.
14
15 srcdir=@srcdir@
16 include @TOP_OBJDIR@/src/config/Makefile.config
17
18 CFLAGS=-I. -I${srcdir} ${DBUG} -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR}  ${XCFLAGS} ${ARCHFLAGS}
19 SFLAGS=-I${TOP_INCDIR}
20 LIBS=libsys.a ${TOP_LIBDIR}/librx.a libsys.a ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/util.a ${XLIBS}
21
22 OBJECTS= afssyscalls.o setpag.o glue.o syscall.o
23 SHLIBOBJS = picobj/setpag.o picobj/glue.o syscall.o
24 RMTOBJS=rmtsysnet.o rmtsysc.o rmtsys.cs.o rmtsys.xdr.o rmtsys.ss.o rmtsyss.o 
25
26 LIBAFSSETPAG = libafssetpag.${SHLIB_SUFFIX}.${LIBAFSSETPAGMAJOR}.${LIBAFSSETPAGMINOR}
27 LIBAFSSETPAG_DARWIN = libafssetpag.${LIBAFSSETPAGMAJOR}.${SHLIB_SUFFIX}
28
29 all: \
30     rmtsysd \
31     pagsh \
32     pagsh.krb \
33     ${TOP_INCDIR}/afs/afssyscalls.h \
34     ${TOP_INCDIR}/afs/afs.exp \
35     ${TOP_INCDIR}/afs/xfsattrs.h \
36     ${TOP_LIBDIR}/afs.exp \
37     ${TOP_LIBDIR}/libsys.a \
38     ${KERNELDIR}/afs \
39     ${KERNELDIR}/afs/xfsattrs.h \
40     ${UKERNELDIR}/afs \
41     ${UKERNELDIR}/afs/afsl.exp
42         @set -x; case ${SYS_NAME} in \
43         *_darwin_*) \
44             ${MAKE} '${TOP_LIBDIR}/${LIBAFSSETPAG_DARWIN}';; \
45         *) \
46             ${MAKE} '${TOP_LIBDIR}/${LIBAFSSETPAG}';; \
47         esac
48
49 libsys.a: ${OBJECTS} ${RMTOBJS} afsl.exp AFS_component_version_number.o
50         -$(RM) -f $@
51         $(AR) crv $@ ${OBJECTS} ${RMTOBJS} \
52                 AFS_component_version_number.o ${LIBSYS_AIX_EXP}
53         $(RANLIB) $@
54         @set -x; case "${SYS_NAME}" in                          \
55                 rs_aix*)                                \
56                         $(AR) crv $@ afsl.exp;;         \
57         esac
58
59 ${LIBAFSSETPAG}: ${SHLIBOBJS}
60         @set -x; case ${SYS_NAME} in \
61         *_linux*) \
62             ${SHLIB_LINKER} -Wl,-h,libafssetpag.so.${LIBAFSSETPAGMAJOR} \
63                 -o ${LIBAFSSETPAG} -Wl,--version-script=${srcdir}/mapfile \
64                 ${SHLIBOBJS};; \
65         rs_aix4*) \
66             ${SHLIB_LINKER} -o ${LIBAFSSETPAG} ${SHLIBOBJS} \
67                 -bE:afssetpag.exp;; \
68         sun*_5*) \
69             ${SHLIB_LINKER} -h libafssetpag.so.${LIBAFSSETPAGMAJOR} \
70                 -o ${LIBAFSSETPAG} ${SHLIBOBJS};; \
71         *) \
72             ${SHLIB_LINKER} -o ${LIBAFSSETPAG} ${SHLIBOBJS};; \
73         esac
74
75 ${LIBAFSSETPAG_DARWIN}: ${SHLIBOBJS}
76         ${SHLIB_LINKER} -o ${LIBAFSSETPAG_DARWIN} ${ARCHFLAGS} -install_name ${libdir}/${LIBAFSSETPAG_DARWIN} -compatibility_version ${LIBAFSSETPAGMAJOR} -current_version ${LIBAFSSETPAGMAJOR}.${LIBAFSSETPAGMINOR} ${SHLIBOBJS}
77
78 tests:  pagsh pagsh.krb fixit iinc idec icreate iopen istat rmtsysd
79
80 syscall.o: syscall.s
81         @set -x; case "$(SYS_NAME)" in \
82          sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53  | sun4_53 | sun4_52 | sun4_54 | sun4c_54 | sun4m_54 | sun4x_5? | sun4x_5?? | sunx86_5? | sunx86_5?? ) \
83                 /usr/ccs/lib/cpp -P ${SFLAGS} ${srcdir}/syscall.s syscall.ss; \
84                 as -o syscall.o syscall.ss;             \
85                 $(RM) syscall.ss;;                              \
86          sgi_* |*_darwin* ) \
87                 ${CC} ${CFLAGS} -c ${srcdir}/syscall.s;;          \
88          alpha_osf1 | alpha_osf20 |  alpha_osf30 | alpha_osf32 | alpha_osf32c | alpha_dux?? ) \
89                 ${AS} -P ${CFLAGS} -D_NO_PROTO -DMACH -DOSF -nostdinc -traditional -DASSEMBLER ${srcdir}/syscall.s; \
90                 ${AS} -o syscall.o syscall.i; \
91                 $(RM) -f syscall.ss syscall.i;; \
92          hp_ux11? ) \
93                 touch syscall.o;; \
94          amd64_fbsd*|i386_*bsd*|*nbsd*) \
95                 ${CCOBJ} -E ${SFLAGS} syscall.s > syscall.S ; \
96                 ${AS} syscall.S -o syscall.o ;  \
97                 $(RM) -f syscall.S ;;\
98          *) \
99                 /lib/cpp -P ${SFLAGS} ${srcdir}/syscall.s syscall.ss; \
100                 as -o syscall.o syscall.ss;             \
101                 $(RM) syscall.ss;;                              \
102         esac
103
104 afssyscalls.o: afssyscalls.c afssyscalls.h
105         ${CCOBJ} ${CFLAGS} -c ${srcdir}/afssyscalls.c
106
107 glue.o: glue.c afssyscalls.h
108         ${CCOBJ} ${CFLAGS} -c ${srcdir}/glue.c
109
110 setpag.o: setpag.c afssyscalls.h
111         ${CCOBJ} ${CFLAGS} -c ${srcdir}/setpag.c
112
113 picobj: afssyscalls.h
114         mkdir -p picobj
115         cp ${srcdir}/afssyscalls.h picobj/afssyscalls.h
116
117 picobj/glue.o: picobj glue.c afssyscalls.h
118         rm -f picobj/glue.c
119         cp ${srcdir}/glue.c picobj/glue.c
120         cd picobj && ${CCOBJ} ${CFLAGS} ${SHLIB_CFLAGS} -c glue.c
121
122 picobj/setpag.o: picobj setpag.c afssyscalls.h
123         rm -f picobj/setpag.c
124         cp ${srcdir}/setpag.c picobj/setpag.c
125         cd picobj && ${CCOBJ} ${CFLAGS} ${SHLIB_CFLAGS} -c setpag.c
126
127 rmtsysnet.o rmtsysc.o rmtsyss.o rmtsysd.o: rmtsys.h
128 rmtsysd: AFS_component_version_number.o afs.exp afsl.exp
129
130 rmtsys.cs.c: rmtsys.xg
131         ${RXGEN} -C -o $@ ${srcdir}/rmtsys.xg
132
133 rmtsys.ss.c: rmtsys.xg
134         ${RXGEN} -S -o $@ ${srcdir}/rmtsys.xg
135
136 rmtsys.xdr.c: rmtsys.xg
137         ${RXGEN} -c -o $@ ${srcdir}/rmtsys.xg
138
139 rmtsys.h: rmtsys.xg
140         ${RXGEN} -h -o $@ ${srcdir}/rmtsys.xg
141
142 rmtsysd: rmtsysd.o libsys.a
143         ${CC} ${CFLAGS} -o rmtsysd rmtsysd.o ${LIBS}
144
145 pagsh:  libsys.a AFS_component_version_number.o
146         ${CC} ${CFLAGS} -c ${srcdir}/pagsh.c
147         ${CC} ${CFLAGS} -o pagsh pagsh.o ${LIBS}
148
149 pagsh.krb: libsys.a
150         ${CC} ${CFLAGS} -c ${srcdir}/pagsh.c -DAFS_KERBEROS_ENV 
151         ${CC} ${CFLAGS} -o pagsh.krb pagsh.o ${LIBS}
152
153 #
154 # Test programs.
155 #
156
157 iinc:   iinc.c 
158         $(CC) -o iinc ${CFLAGS} ${srcdir}/iinc.c ${LIBS}
159
160 idec:   idec.c  AFS_component_version_number.c
161         $(CC) -o idec ${CFLAGS} ${srcdir}/idec.c ${LIBS}
162
163 icreate:icreate.c  AFS_component_version_number.c
164         $(CC) -o icreate ${CFLAGS} ${srcdir}/icreate.c ${LIBS}
165
166 iopen:  iopen.c  AFS_component_version_number.c
167         $(CC) -o iopen ${CFLAGS} ${srcdir}/iopen.c ${LIBS}
168
169 iread:  iread.c  AFS_component_version_number.c
170         ${CC} -o iread ${CFLAGS} ${srcdir}/iread.c ${LIBS}
171
172 iwrite: iwrite.c  AFS_component_version_number.c
173         ${CC} -o iwrite ${CFLAGS} ${srcdir}/iwrite.c ${LIBS}
174
175 istat:  istat.c  AFS_component_version_number.c
176         $(CC) -o istat ${CFLAGS} ${srcdir}/istat.c ${LIBS}
177
178 fixit:  fixit.c AFS_component_version_number.c
179         $(CC) -o fixit ${CFLAGS} ${srcdir}/fixit.c ${LIBS}
180
181
182 xfsinode: xfsinode.c  AFS_component_version_number.c
183         @set -x; case "${SYS_NAME}" in \
184                 sgi_62 | sgi_64 ) \
185                 $(CC) -o xfsinode ${CFLAGS} ${srcdir}/xfsinode.c ${LIBS}
186         esac
187
188 ${TOP_LIBDIR}/${LIBAFSSETPAG}: ${LIBAFSSETPAG}
189         ${INSTALL} ${LIBAFSSETPAG} ${TOP_LIBDIR}/${LIBAFSSETPAG}
190         -ln -f -s ${LIBAFSSETPAG} ${TOP_LIBDIR}/libafssetpag.${SHLIB_SUFFIX}
191         -ln -f -s ${LIBAFSSETPAG} ${TOP_LIBDIR}/libafssetpag.${SHLIB_SUFFIX}.${LIBAFSSETPAGMAJOR}
192
193 ${TOP_LIBDIR}/${LIBAFSSETPAG_DARWIN}: ${LIBAFSSETPAG_DARWIN}
194         ${INSTALL} ${LIBAFSSETPAG_DARWIN} ${TOP_LIBDIR}/${LIBAFSSETPAG_DARWIN}
195         -ln -f -s ${LIBAFSSETPAG_DARWIN} ${TOP_LIBDIR}/libafssetpag.${SHLIB_SUFFIX}
196         -ln -f -s ${LIBAFSSETPAG_DARWIN} ${TOP_LIBDIR}/libafssetpag.${LIBAFSSETPAGMAJOR}.${LIBAFSSETPAGMINOR}.${SHLIB_SUFFIX}
197  
198
199 afs.exp: ${srcdir}/afs4.exp ${srcdir}/afs5.exp
200         @set -x; case ${SYS_NAME} in \
201                 rs_aix5* ) \
202                         cp -p ${srcdir}/afs5.exp afs.exp ;; \
203                 rs_aix* ) \
204                         cp -p ${srcdir}/afs4.exp afs.exp ;; \
205                 * ) \
206                         touch afs.exp ;; \
207         esac
208
209 afsl.exp: ${srcdir}/afsl4.exp ${srcdir}/afsl5.exp
210         @set -x; case ${SYS_NAME} in \
211                 rs_aix5* ) \
212                         cp -p ${srcdir}/afsl5.exp afsl.exp ;; \
213                 rs_aix* ) \
214                         cp -p ${srcdir}/afsl4.exp afsl.exp ;; \
215                 * ) \
216                         touch afsl.exp ;; \
217         esac
218
219 #
220 # Installation targets
221 #
222
223 ${TOP_INCDIR}/afs/afssyscalls.h: afssyscalls.h
224         ${INSTALL} $? $@
225
226 ${TOP_INCDIR}/afs/afs.exp: afs.exp
227         @set -x; case ${SYS_NAME} in \
228                 rs_aix* ) \
229                         ${INSTALL} $? $@ ;; \
230         esac
231
232 ${TOP_LIBDIR}/afs.exp: afs.exp
233         @set -x; case ${SYS_NAME} in \
234                 rs_aix* ) \
235                         ${INSTALL} $? $@ ;; \
236         esac
237
238 ${TOP_INCDIR}/afs/xfsattrs.h: xfsattrs.h
239         ${INSTALL} $? $@
240
241 ${TOP_LIBDIR}/libsys.a: libsys.a
242         ${INSTALL} $? $@
243
244 ${UKERNELDIR}/afs:
245         mkdir -p $@
246
247 ${UKERNELDIR}/afs/afsl.exp: afsl.exp
248         @set -x; case ${SYS_NAME} in \
249                 rs_aix* ) \
250                         ${INSTALL} $? $@ ;; \
251         esac
252
253 ${KERNELDIR}/afs:
254         mkdir -p $@
255
256 ${KERNELDIR}/afs/xfsattrs.h: xfsattrs.h
257         ${INSTALL} $? $@
258
259 depinstall: \
260         ${TOP_INCDIR}/afs/afssyscalls.h \
261         ${TOP_INCDIR}/afs/afs.exp \
262         ${TOP_INCDIR}/afs/xfsattrs.h \
263         ${KERNELDIR}/afs/xfsattrs.h \
264         ${UKERNELDIR}/afs/afsl.exp
265
266 install: \
267     ${DESTDIR}${libdir}/afs/libsys.a \
268     ${DESTDIR}${sbindir}/rmtsysd \
269     ${DESTDIR}${includedir}/afs/afssyscalls.h \
270     ${DESTDIR}${bindir}/pagsh \
271     ${DESTDIR}${bindir}/pagsh.krb \
272     ${DESTDIR}${includedir}/afs/afs.exp \
273     ${DESTDIR}${includedir}/afs/xfsattrs.h
274         @set -x; case ${SYS_NAME} in \
275         *_darwin_*) \
276             ${MAKE} '${DESTDIR}${libdir}/${LIBAFSSETPAG_DARWIN}';; \
277         *) \
278             ${MAKE} '${DESTDIR}${libdir}/${LIBAFSSETPAG}';; \
279         esac
280
281 ${DESTDIR}${libdir}/afs/libsys.a: libsys.a
282         ${INSTALL} $? $@
283
284 ${DESTDIR}${libdir}/${LIBAFSSETPAG}: ${LIBAFSSETPAG}
285         ${INSTALL} ${LIBAFSSETPAG} ${DESTDIR}${libdir}/${LIBAFSSETPAG}
286         -ln -f -s ${LIBAFSSETPAG} \
287             ${DESTDIR}${libdir}/libafssetpag.${SHLIB_SUFFIX}
288         -ln -f -s ${LIBAFSSETPAG} \
289             ${DESTDIR}${libdir}/libafssetpag.${SHLIB_SUFFIX}.${LIBAFSSETPAGMAJOR}
290
291 ${DESTDIR}${libdir}/${LIBAFSSETPAG_DARWIN}: ${LIBAFSSETPAG_DARWIN}
292         ${INSTALL} ${LIBAFSSETPAG_DARWIN} ${DESTDIR}${libdir}/${LIBAFSSETPAG_DARWIN}
293         -ln -f -s ${LIBAFSSETPAG_DARWIN} \
294                 ${DESTDIR}${libdir}/libafssetpag.${SHLIB_SUFFIX} ; \
295         -ln -f -s ${LIBAFSSETPAG_DARWIN} \
296                 ${DESTDIR}${libdir}/libafssetpag.${LIBAFSSETPAGMAJOR}.${LIBAFSSETPAGMINOR}.${SHLIB_SUFFIX} ;; \
297
298 ${DESTDIR}${sbindir}/rmtsysd: rmtsysd
299         ${INSTALL} -s $? $@
300
301 ${DESTDIR}${includedir}/afs/afssyscalls.h: afssyscalls.h
302         ${INSTALL} $? $@
303
304 ${DESTDIR}${bindir}/pagsh: pagsh
305         ${INSTALL} -s $? $@
306
307 ${DESTDIR}${bindir}/pagsh.krb: pagsh.krb
308         ${INSTALL} -s $? $@
309
310 ${DESTDIR}${includedir}/afs/afs.exp: afs.exp
311         @set -x; case ${SYS_NAME} in \
312                 rs_aix* ) \
313                         ${INSTALL} $? $@ ;; \
314         esac
315
316 ${DESTDIR}${includedir}/afs/xfsattrs.h: xfsattrs.h
317         ${INSTALL} $? $@
318
319 dest: \
320     ${DEST}/lib/afs/libsys.a \
321     ${DEST}/etc/rmtsysd \
322     ${DEST}/bin/pagsh \
323     ${DEST}/bin/pagsh.krb \
324     ${DEST}/include/afs/afssyscalls.h \
325     ${DEST}/include/afs/afs.exp \
326     ${DEST}/include/afs/xfsattrs.h
327         @set -x; case ${SYS_NAME} in \
328         *_darwin_*) \
329             ${MAKE} '${TOP_LIBDIR}/${LIBAFSSETPAG_DARWIN}';; \
330         *) \
331             ${MAKE} '${TOP_LIBDIR}/${LIBAFSSETPAG}';; \
332         esac
333
334 ${DEST}/lib/afs/libsys.a: libsys.a
335         ${INSTALL} $? $@
336
337 ${DEST}/include/afs/afs.exp: afs.exp
338         @set -x; case ${SYS_NAME} in \
339                 rs_aix* ) \
340                         ${INSTALL} $? $@ ;; \
341         esac
342
343 ${DEST}/include/afs/xfsattrs.h: xfsattrs.h
344         ${INSTALL} $? $@
345
346 ${DEST}/include/afs/afssyscalls.h: afssyscalls.h
347         ${INSTALL} $? $@
348
349 ${DEST}/etc/rmtsysd: rmtsysd
350         ${INSTALL} -s $? $@
351
352 ${DEST}/bin/pagsh: pagsh
353         ${INSTALL} -s $? $@
354
355 ${DEST}/bin/pagsh.krb: pagsh.krb
356         ${INSTALL} -s $? $@
357
358 #
359 # Misc targets
360 #
361 include ../config/Makefile.version
362
363 clean:
364         $(RM) -f *.o libsys.a xfsinode iinc idec icreate iopen istat core \
365         rmtsysc rmtsyss *.o rmtsys.ss.c rmtsys.cs.c rmtsys.xdr.c rmtsys.h \
366         rmtsysd AFS_component_version_number.c pagsh pagsh.krb \
367         afs.exp afsl.exp libafssetpag.*
368         $(RM) -rf picobj