Initial OpenBSD support. Most of user space builds. No kernel module yet.
[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 # System calls.
9
10 DEST=@DEST@
11 TOP_INCDIR=@TOP_INCDIR@
12 TOP_LIBDIR=@TOP_LIBDIR@
13 prefix=@prefix@
14 exec_prefix=@exec_prefix@
15 bindir=@bindir@
16 sbindir=@sbindir@
17 libexecdir=@libexecdir@
18 libdir=@libdir@
19 includedir=@includedir@
20 mandir=@mandir@
21 afssrvbindir=@afssrvbindir@
22 afssrvsbindir=@afssrvsbindir@
23 afssrvlibexecdir=@afssrvlibexecdir@
24 COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et
25 RXGEN=${TOP_SRCDIR}/rxgen/rxgen
26 TOP_SRCDIR=@TOP_SRCDIR@
27 SYS_NAME=@AFS_SYSNAME@
28
29 SHELL = /bin/sh
30
31 include ../config/Makefile.${SYS_NAME}
32
33 UKERNELDIR=../libuafs/
34 CFLAGS=${DBUG} -I${TOP_SRCDIR}/config -I${TOP_INCDIR}  ${XCFLAGS}
35 SFLAGS=-P -I${TOP_INCDIR}
36 LIBS=libsys.a ${TOP_LIBDIR}/librx.a libsys.a ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/util.a ${XLIBS}
37 UKSRCS=afsl.exp
38
39 OBJECTS= afssyscalls.o syscall.o
40 RMTOBJS=rmtsysnet.o rmtsysc.o rmtsys.cs.o rmtsys.xdr.o rmtsys.ss.o rmtsyss.o 
41
42 include ../config/Makefile.version
43
44 all: ${TOP_LIBDIR}/libsys.a rmtsysd ${TOP_INCDIR}/afs/afssyscalls.h pagsh pagsh.krb kinstall ukinstall
45         case "${SYS_NAME}" in \
46         rs_aix*)                        \
47                 ${INSTALL} afs.exp ${TOP_LIBDIR};;      \
48         sgi_6? ) \
49                 ${INSTALL} xfsattrs.h ${TOP_INCDIR}/afs;; \
50         esac
51
52 install: ${DESTDIR}${libdir}/afs/libsys.a ${DESTDIR}${sbindir}/rmtsysd ${DESTDIR}${includedir}/afs/afssyscalls.h ${DESTDIR}${bindir}/pagsh ${DESTDIR}${bindir}/pagsh.krb  
53         case "${SYS_NAME}" in \
54         rs_aix*)                        \
55                 ${INSTALL} afs.exp ${DESTDIR}${includedir}/afs;;        \
56         sgi_6? ) \
57                 ${INSTALL} xfsattrs.h ${DESTDIR}${includedir}/afs;; \
58         esac
59
60 ${DEST}/etc/rmtsysd: rmtsysd
61         ${INSTALL} -s $? $@
62
63 ${DEST}/bin/pagsh: pagsh
64         ${INSTALL} -s $? $@
65
66 ${DEST}/bin/pagsh.krb: pagsh.krb
67         ${INSTALL} -s $? $@
68
69 ${DEST}/include/afs/afssyscalls.h: afssyscalls.h
70         ${INSTALL} $? $@
71
72 libsys.a: ${OBJECTS} ${RMTOBJS} AFS_component_version_number.o
73         -$(RM) -f $@
74         $(AR) crv $@ ${OBJECTS} ${RMTOBJS} AFS_component_version_number.o
75         $(RANLIB) $@
76         case "${SYS_NAME}" in                           \
77             rs_aix*)            \
78                 $(AR) crv $@ afsl.exp;;         \
79         esac
80
81 kinstall:
82         case "${SYS_NAME}" in                           \
83             rs_aix*)                    \
84                 ${INSTALL} afs.exp ${TOP_LIBDIR}/afs;;  \
85             sgi_6? ) \
86                 ${INSTALL} xfsattrs.h ../libafs/afs;; \
87             *)                                          \
88                 echo No $@ source here;;                \
89         esac
90
91 ukinstall webinstall: ${UKERNELDIR}/afs ${UKSRCS}
92         ${INSTALL} ${UKSRCS} ${UKERNELDIR}/afs
93
94 ${UKERNELDIR}/afs:
95         mkdir -p $@
96
97 tests:  pagsh pagsh.krb fixit iinc idec icreate iopen istat rmtsysd
98
99 syscall.o: syscall.s
100         case "$(SYS_NAME)" in \
101          sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53  | sun4_53 | sun4_52 | sun4_54 | sun4c_54 | sun4m_54 | sun4x_5? | sunx86_54) \
102                 /usr/ccs/lib/cpp  ${SFLAGS} syscall.s syscall.ss; \
103                 as -o syscall.o syscall.ss;             \
104                 $(RM) syscall.ss;;                              \
105          sgi_* |ppc_darwin* ) \
106                 ${CC} ${CFLAGS} -c syscall.s;;          \
107          alpha_osf1 | alpha_osf20 |  alpha_osf30 | alpha_osf32 | alpha_osf32c | alpha_dux?? ) \
108                 ${AS} -P ${CFLAGS} -D_NO_PROTO -DMACH -DOSF -nostdinc -traditional -DASSEMBLER syscall.s; \
109                 ${AS} -o syscall.o syscall.i; \
110                 $(RM) -f syscall.ss syscall.i;; \
111          hp_ux11? ) \
112                 touch syscall.o;; \
113         i386_*bsd* ) \
114                 touch syscall.o;; \
115          *) \
116                 /lib/cpp  ${SFLAGS} syscall.s syscall.ss; \
117                 as -o syscall.o syscall.ss;             \
118                 $(RM) syscall.ss;;                              \
119         esac
120
121
122 afssyscalls.o: afssyscalls.c afssyscalls.h
123         ${CC} ${CFLAGS} -c afssyscalls.c
124
125 rmtsysnet.o rmtsysc.o rmtsyss.o rmtsysd.o: rmtsys.h
126 rmtsysd: AFS_component_version_number.o
127
128 rmtsys.cs.c rmtsys.ss.c rmtsys.xdr.c rmtsys.h: rmtsys.xg
129         ${RXGEN} rmtsys.xg
130
131 rmtsysd: rmtsysd.o libsys.a
132         ${CC} ${CFLAGS} -o rmtsysd rmtsysd.o ${LIBS}
133
134
135 pagsh:  libsys.a AFS_component_version_number.o
136         ${CC} ${CFLAGS} -c pagsh.c
137         ${CC} ${CFLAGS} -o pagsh pagsh.o ${LIBS}
138
139 pagsh.krb: libsys.a
140         ${CC} ${CFLAGS} -c pagsh.c -DAFS_KERBEROS_ENV 
141         ${CC} ${CFLAGS} -o pagsh.krb pagsh.o ${LIBS}
142
143 # Test programs.
144
145 iinc:   iinc.c 
146         case "${SYS_NAME}" in                           \
147             sgi_6*) \
148                 $(CC) -o iinc ${CFLAGS} iinc.c libsys.a;; \
149             *)                                          \
150                 $(CC) -o iinc -I${TOP_INCDIR} iinc.c ${LIBS} ${XLIBS};; \
151         esac
152 idec:   idec.c  AFS_component_version_number.c
153         case "${SYS_NAME}" in                           \
154             sgi_6* ) \
155                 $(CC) -o idec ${CFLAGS} idec.c libsys.a;; \
156             *)                                          \
157                 $(CC) -o idec -I${TOP_INCDIR} idec.c ${LIBS} ${XLIBS};; \
158         esac
159 icreate:icreate.c  AFS_component_version_number.c
160         case "${SYS_NAME}" in                           \
161             sgi_6* ) \
162                 $(CC) -o icreate ${CFLAGS} icreate.c libsys.a;; \
163             *)                                          \
164                 $(CC) -o icreate -I${TOP_INCDIR} icreate.c ${XLIBS};; \
165         esac
166 iopen:  iopen.c  AFS_component_version_number.c
167         case "${SYS_NAME}" in                           \
168             sgi_6* ) \
169                 $(CC) -o iopen ${CFLAGS} iopen.c libsys.a;; \
170             *)                                          \
171                 $(CC) -o iopen -I${TOP_INCDIR} iopen.c ${XLIBS};; \
172         esac
173 iread:  iread.c  AFS_component_version_number.c
174         case "${SYS_NAME}" in                           \
175             sgi_6* ) \
176                 ${CC} -o iread ${CFLAGS} iread.c libsys.a;; \
177             *)                                          \
178                 ${CC} -o iread -I${TOP_INCDIR} iread.c ${XLIBS};; \
179         esac
180 iwrite: iwrite.c  AFS_component_version_number.c
181         case "${SYS_NAME}" in                           \
182             sgi_6* ) \
183                 ${CC} -o iwrite ${CFLAGS} iwrite.c libsys.a;; \
184             *)                                          \
185                 ${CC} -o iwrite -I${TOP_INCDIR} iwrite.c ${XLIBS};; \
186         esac
187 istat:  istat.c  AFS_component_version_number.c
188         case "${SYS_NAME}" in                           \
189                 sgi_6* ) \
190                 $(CC) -o istat ${CFLAGS} istat.c libsys.a;; \
191             *)                                          \
192                 $(CC) -o istat -I${TOP_INCDIR} istat.c ${XLIBS};; \
193         esac
194 fixit:  fixit.c AFS_component_version_number.c
195         $(CC) -o fixit -IDEST/include fixit.c libsys.a 
196
197
198 xfsinode: xfsinode.c  AFS_component_version_number.c
199         case "${SYS_NAME}" in \
200                 sgi_62 | sgi_64 ) \
201                 $(CC) -o xfsinode ${CFLAGS} xfsinode.c libsys.a;; \
202         esac
203
204
205
206 clean:
207         $(RM) -f *.o libsys.a xfsinode iinc idec icreate iopen istat core \
208         rmtsysc rmtsyss *.o rmtsys.ss.c rmtsys.cs.c rmtsys.xdr.c rmtsys.h \
209         rmtsysd AFS_component_version_number.c pagsh pagsh.krb
210 ${DEST}/lib/afs/libsys.a: libsys.a
211         ${INSTALL} $? $@
212
213 ${DESTDIR}${libdir}/afs/libsys.a: libsys.a
214         ${INSTALL} $? $@
215
216
217 ${TOP_LIBDIR}/libsys.a: libsys.a
218         ${INSTALL} $? $@
219
220
221 ${DESTDIR}${sbindir}/rmtsysd: rmtsysd
222         ${INSTALL} -s $? $@
223
224 ${DESTDIR}${includedir}/afs/afssyscalls.h: afssyscalls.h
225         ${INSTALL} $? $@
226
227 ${TOP_INCDIR}/afs/afssyscalls.h: afssyscalls.h
228         ${INSTALL} $? $@
229
230 ${DESTDIR}${bindir}/pagsh: pagsh
231         ${INSTALL} -s $? $@
232
233 ${DESTDIR}${bindir}/pagsh.krb: pagsh.krb
234         ${INSTALL} -s $? $@
235
236 dest: ${DEST}/lib/afs/libsys.a ${DEST}/etc/rmtsysd ${DEST}/include/afs/afssyscalls.h ${DEST}/bin/pagsh ${DEST}/bin/pagsh.krb  
237         case "${SYS_NAME}" in \
238         rs_aix*)                        \
239                 ${INSTALL} afs.exp ${DEST}/include/afs;;        \
240         sgi_6? ) \
241                 ${INSTALL} xfsattrs.h ${DEST}/include/afs;; \
242         esac
243