solaris10-20040624
[openafs.git] / src / sys / 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 # Portions Copyright (c) 2003 Apple Computer, Inc.
9
10 srcdir=@srcdir@
11 include @TOP_OBJDIR@/src/config/Makefile.config
12
13 CFLAGS=-I. -I${srcdir} ${DBUG} -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR}  ${XCFLAGS}
14 SFLAGS=-P -I${TOP_INCDIR}
15 LIBS=libsys.a ${TOP_LIBDIR}/librx.a libsys.a ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/util.a ${XLIBS}
16
17 OBJECTS= afssyscalls.o syscall.o
18 RMTOBJS=rmtsysnet.o rmtsysc.o rmtsys.cs.o rmtsys.xdr.o rmtsys.ss.o rmtsyss.o 
19
20 all: \
21         rmtsysd \
22         pagsh \
23         pagsh.krb \
24         ${TOP_INCDIR}/afs/afssyscalls.h \
25         ${TOP_INCDIR}/afs/afs.exp \
26         ${TOP_INCDIR}/afs/xfsattrs.h \
27         ${TOP_LIBDIR}/afs.exp \
28         ${TOP_LIBDIR}/libsys.a \
29         ${KERNELDIR}/afs \
30         ${KERNELDIR}/afs/xfsattrs.h \
31         ${UKERNELDIR}/afs \
32         ${UKERNELDIR}/afs/afsl.exp
33
34 libsys.a: ${OBJECTS} ${RMTOBJS} afsl.exp AFS_component_version_number.o
35         -$(RM) -f $@
36         $(AR) crv $@ ${OBJECTS} ${RMTOBJS} \
37                 AFS_component_version_number.o ${LIBSYS_AIX_EXP}
38         $(RANLIB) $@
39         case "${SYS_NAME}" in                           \
40                 rs_aix*)                                \
41                         $(AR) crv $@ afsl.exp;;         \
42         esac
43
44 tests:  pagsh pagsh.krb fixit iinc idec icreate iopen istat rmtsysd
45
46 syscall.o: syscall.s
47         case "$(SYS_NAME)" in \
48          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?? ) \
49                 /usr/ccs/lib/cpp  ${SFLAGS} ${srcdir}/syscall.s syscall.ss; \
50                 as -o syscall.o syscall.ss;             \
51                 $(RM) syscall.ss;;                              \
52          sgi_* |*_darwin* ) \
53                 ${CC} ${CFLAGS} -c ${srcdir}/syscall.s;;          \
54          alpha_osf1 | alpha_osf20 |  alpha_osf30 | alpha_osf32 | alpha_osf32c | alpha_dux?? ) \
55                 ${AS} -P ${CFLAGS} -D_NO_PROTO -DMACH -DOSF -nostdinc -traditional -DASSEMBLER ${srcdir}/syscall.s; \
56                 ${AS} -o syscall.o syscall.i; \
57                 $(RM) -f syscall.ss syscall.i;; \
58          hp_ux11? ) \
59                 touch syscall.o;; \
60         i386_*bsd*|*nbsd*) \
61                 touch syscall.o;; \
62          *) \
63                 /lib/cpp  ${SFLAGS} ${srcdir}/syscall.s syscall.ss; \
64                 as -o syscall.o syscall.ss;             \
65                 $(RM) syscall.ss;;                              \
66         esac
67
68 afssyscalls.o: afssyscalls.c afssyscalls.h
69         ${CCOBJ} ${CFLAGS} -c ${srcdir}/afssyscalls.c
70
71 rmtsysnet.o rmtsysc.o rmtsyss.o rmtsysd.o: rmtsys.h
72 rmtsysd: AFS_component_version_number.o afs.exp afsl.exp
73
74 rmtsys.cs.c: rmtsys.xg
75         ${RXGEN} -C -o $@ ${srcdir}/rmtsys.xg
76
77 rmtsys.ss.c: rmtsys.xg
78         ${RXGEN} -S -o $@ ${srcdir}/rmtsys.xg
79
80 rmtsys.xdr.c: rmtsys.xg
81         ${RXGEN} -c -o $@ ${srcdir}/rmtsys.xg
82
83 rmtsys.h: rmtsys.xg
84         ${RXGEN} -h -o $@ ${srcdir}/rmtsys.xg
85
86 rmtsysd: rmtsysd.o libsys.a
87         ${CC} ${CFLAGS} -o rmtsysd rmtsysd.o ${LIBS}
88
89 pagsh:  libsys.a AFS_component_version_number.o
90         ${CC} ${CFLAGS} -c ${srcdir}/pagsh.c
91         ${CC} ${CFLAGS} -o pagsh pagsh.o ${LIBS}
92
93 pagsh.krb: libsys.a
94         ${CC} ${CFLAGS} -c ${srcdir}/pagsh.c -DAFS_KERBEROS_ENV 
95         ${CC} ${CFLAGS} -o pagsh.krb pagsh.o ${LIBS}
96
97 #
98 # Test programs.
99 #
100
101 iinc:   iinc.c 
102         $(CC) -o iinc ${CFLAGS} ${srcdir}/iinc.c ${LIBS}
103
104 idec:   idec.c  AFS_component_version_number.c
105         $(CC) -o idec ${CFLAGS} ${srcdir}/idec.c ${LIBS}
106
107 icreate:icreate.c  AFS_component_version_number.c
108         $(CC) -o icreate ${CFLAGS} ${srcdir}/icreate.c ${LIBS}
109
110 iopen:  iopen.c  AFS_component_version_number.c
111         $(CC) -o iopen ${CFLAGS} ${srcdir}/iopen.c ${LIBS}
112
113 iread:  iread.c  AFS_component_version_number.c
114         ${CC} -o iread ${CFLAGS} ${srcdir}/iread.c ${LIBS}
115
116 iwrite: iwrite.c  AFS_component_version_number.c
117         ${CC} -o iwrite ${CFLAGS} ${srcdir}/iwrite.c ${LIBS}
118
119 istat:  istat.c  AFS_component_version_number.c
120         $(CC) -o istat ${CFLAGS} ${srcdir}/istat.c ${LIBS}
121
122 fixit:  fixit.c AFS_component_version_number.c
123         $(CC) -o fixit ${CFLAGS} ${srcdir}/fixit.c ${LIBS}
124
125
126 xfsinode: xfsinode.c  AFS_component_version_number.c
127         case "${SYS_NAME}" in \
128                 sgi_62 | sgi_64 ) \
129                 $(CC) -o xfsinode ${CFLAGS} ${srcdir}/xfsinode.c ${LIBS}
130         esac
131
132 afs.exp: ${srcdir}/afs4.exp ${srcdir}/afs5.exp
133         case ${SYS_NAME} in \
134                 rs_aix5* ) \
135                         cp -p ${srcdir}/afs5.exp afs.exp ;; \
136                 rs_aix* ) \
137                         cp -p ${srcdir}/afs4.exp afs.exp ;; \
138                 * ) \
139                         touch afs.exp ;; \
140         esac
141
142 afsl.exp: ${srcdir}/afsl4.exp ${srcdir}/afsl5.exp
143         case ${SYS_NAME} in \
144                 rs_aix5* ) \
145                         cp -p ${srcdir}/afsl5.exp afsl.exp ;; \
146                 rs_aix* ) \
147                         cp -p ${srcdir}/afsl4.exp afsl.exp ;; \
148                 * ) \
149                         touch afsl.exp ;; \
150         esac
151
152 #
153 # Installation targets
154 #
155
156 ${TOP_INCDIR}/afs/afssyscalls.h: afssyscalls.h
157         ${INSTALL} $? $@
158
159 ${TOP_INCDIR}/afs/afs.exp: afs.exp
160         case ${SYS_NAME} in \
161                 rs_aix* ) \
162                         ${INSTALL} $? $@ ;; \
163         esac
164
165 ${TOP_LIBDIR}/afs.exp: afs.exp
166         case ${SYS_NAME} in \
167                 rs_aix* ) \
168                         ${INSTALL} $? $@ ;; \
169         esac
170
171 ${TOP_INCDIR}/afs/xfsattrs.h: xfsattrs.h
172         ${INSTALL} $? $@
173
174 ${TOP_LIBDIR}/libsys.a: libsys.a
175         ${INSTALL} $? $@
176
177 ${UKERNELDIR}/afs:
178         mkdir -p $@
179
180 ${UKERNELDIR}/afs/afsl.exp: afsl.exp
181         case ${SYS_NAME} in \
182                 rs_aix* ) \
183                         ${INSTALL} $? $@ ;; \
184         esac
185
186 ${KERNELDIR}/afs:
187         mkdir -p $@
188
189 ${KERNELDIR}/afs/xfsattrs.h: xfsattrs.h
190         ${INSTALL} $? $@
191
192 install: \
193         ${DESTDIR}${libdir}/afs/libsys.a \
194         ${DESTDIR}${sbindir}/rmtsysd \
195         ${DESTDIR}${includedir}/afs/afssyscalls.h \
196         ${DESTDIR}${bindir}/pagsh \
197         ${DESTDIR}${bindir}/pagsh.krb \
198         ${DESTDIR}${includedir}/afs/afs.exp \
199         ${DESTDIR}${includedir}/afs/xfsattrs.h
200
201 ${DESTDIR}${libdir}/afs/libsys.a: libsys.a
202         ${INSTALL} $? $@
203
204 ${DESTDIR}${sbindir}/rmtsysd: rmtsysd
205         ${INSTALL} -s $? $@
206
207 ${DESTDIR}${includedir}/afs/afssyscalls.h: afssyscalls.h
208         ${INSTALL} $? $@
209
210 ${DESTDIR}${bindir}/pagsh: pagsh
211         ${INSTALL} -s $? $@
212
213 ${DESTDIR}${bindir}/pagsh.krb: pagsh.krb
214         ${INSTALL} -s $? $@
215
216 ${DESTDIR}${includedir}/afs/afs.exp: afs.exp
217         case ${SYS_NAME} in \
218                 rs_aix* ) \
219                         ${INSTALL} $? $@ ;; \
220         esac
221
222 ${DESTDIR}${includedir}/afs/xfsattrs.h: xfsattrs.h
223         ${INSTALL} $? $@
224
225 dest: \
226         ${DEST}/lib/afs/libsys.a \
227         ${DEST}/etc/rmtsysd \
228         ${DEST}/bin/pagsh \
229         ${DEST}/bin/pagsh.krb \
230         ${DEST}/include/afs/afssyscalls.h \
231         ${DEST}/include/afs/afs.exp \
232         ${DEST}/include/afs/xfsattrs.h
233
234 ${DEST}/lib/afs/libsys.a: libsys.a
235         ${INSTALL} $? $@
236
237 ${DEST}/include/afs/afs.exp: afs.exp
238         case ${SYS_NAME} in \
239                 rs_aix* ) \
240                         ${INSTALL} $? $@ ;; \
241         esac
242
243 ${DEST}/include/afs/xfsattrs.h: xfsattrs.h
244         ${INSTALL} $? $@
245
246 ${DEST}/include/afs/afssyscalls.h: afssyscalls.h
247         ${INSTALL} $? $@
248
249 ${DEST}/etc/rmtsysd: rmtsysd
250         ${INSTALL} -s $? $@
251
252 ${DEST}/bin/pagsh: pagsh
253         ${INSTALL} -s $? $@
254
255 ${DEST}/bin/pagsh.krb: pagsh.krb
256         ${INSTALL} -s $? $@
257
258 #
259 # Misc targets
260 #
261 include ../config/Makefile.version
262
263 clean:
264         $(RM) -f *.o libsys.a xfsinode iinc idec icreate iopen istat core \
265         rmtsysc rmtsyss *.o rmtsys.ss.c rmtsys.cs.c rmtsys.xdr.c rmtsys.h \
266         rmtsysd AFS_component_version_number.c pagsh pagsh.krb \
267         afs.exp afsl.exp