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