makefiles-attempt-to-support-gmake-j-20011023
[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.xg
97         ${RXGEN} -C -o $@ ${srcdir}/rmtsys.xg
98         
99 rmtsys.ss.c: rmtsys.xg
100         ${RXGEN} -S -o $@ ${srcdir}/rmtsys.xg
101         
102 rmtsys.xdr.c: rmtsys.xg
103         ${RXGEN} -c -o $@ ${srcdir}/rmtsys.xg
104         
105 rmtsys.h: rmtsys.xg
106         ${RXGEN} -h -o $@ ${srcdir}/rmtsys.xg
107
108 rmtsysd: rmtsysd.o libsys.a
109         ${CC} ${CFLAGS} -o rmtsysd rmtsysd.o ${LIBS}
110
111 pagsh:  libsys.a AFS_component_version_number.o
112         ${CC} ${CFLAGS} -c ${srcdir}/pagsh.c
113         ${CC} ${CFLAGS} -o pagsh pagsh.o ${LIBS}
114
115 pagsh.krb: libsys.a
116         ${CC} ${CFLAGS} -c ${srcdir}/pagsh.c -DAFS_KERBEROS_ENV 
117         ${CC} ${CFLAGS} -o pagsh.krb pagsh.o ${LIBS}
118
119 #
120 # Test programs.
121 #
122
123 iinc:   iinc.c 
124         $(CC) -o iinc ${CFLAGS} ${srcdir}/iinc.c ${LIBS}
125
126 idec:   idec.c  AFS_component_version_number.c
127         $(CC) -o idec ${CFLAGS} ${srcdir}/idec.c ${LIBS}
128
129 icreate:icreate.c  AFS_component_version_number.c
130         $(CC) -o icreate ${CFLAGS} ${srcdir}/icreate.c ${LIBS}
131
132 iopen:  iopen.c  AFS_component_version_number.c
133         $(CC) -o iopen ${CFLAGS} ${srcdir}/iopen.c ${LIBS}
134
135 iread:  iread.c  AFS_component_version_number.c
136         ${CC} -o iread ${CFLAGS} ${srcdir}/iread.c ${LIBS}
137
138 iwrite: iwrite.c  AFS_component_version_number.c
139         ${CC} -o iwrite ${CFLAGS} ${srcdir}/iwrite.c ${LIBS}
140
141 istat:  istat.c  AFS_component_version_number.c
142         $(CC) -o istat ${CFLAGS} ${srcdir}/istat.c ${LIBS}
143
144 fixit:  fixit.c AFS_component_version_number.c
145         $(CC) -o fixit ${CFLAGS} ${srcdir}/fixit.c ${LIBS}
146
147
148 xfsinode: xfsinode.c  AFS_component_version_number.c
149         case "${SYS_NAME}" in \
150                 sgi_62 | sgi_64 ) \
151                 $(CC) -o xfsinode ${CFLAGS} ${srcdir}/xfsinode.c ${LIBS}
152         esac
153
154 #
155 # Installation targets
156 #
157
158 ${TOP_INCDIR}/afs/afssyscalls.h: afssyscalls.h
159         ${INSTALL} $? $@
160
161 ${TOP_INCDIR}/afs/afs.exp: afs.exp
162         ${INSTALL} $? $@
163
164 ${TOP_LIBDIR}/afs.exp: afs.exp
165         ${INSTALL} $? $@
166
167 ${TOP_INCDIR}/afs/xfsattrs.h: xfsattrs.h
168         ${INSTALL} $? $@
169
170 ${TOP_LIBDIR}/libsys.a: libsys.a
171         ${INSTALL} $? $@
172
173 ${UKERNELDIR}/afs:
174         mkdir -p $@
175
176 ${UKERNELDIR}/afs/afs.exp: afs.exp
177         ${INSTALL} $? $@
178
179 ${KERNELDIR}/afs:
180         mkdir -p $@
181
182 ${KERNELDIR}/afs/xfsattrs.h: xfsattrs.h
183         ${INSTALL} $? $@
184
185 install: 
186         ${DESTDIR}${libdir}/afs/libsys.a \
187         ${DESTDIR}${sbindir}/rmtsysd \
188         ${DESTDIR}${includedir}/afs/afssyscalls.h \
189         ${DESTDIR}${bindir}/pagsh \
190         ${DESTDIR}${bindir}/pagsh.krb \
191         ${DESTDIR}${includedir}/afs/afs.exp \
192         ${DESTDIR}${includedir}/afs/xfsattrs.h
193
194 ${DESTDIR}${libdir}/afs/libsys.a: libsys.a
195         ${INSTALL} $? $@
196
197 ${DESTDIR}${sbindir}/rmtsysd: rmtsysd
198         ${INSTALL} -s $? $@
199
200 ${DESTDIR}${includedir}/afs/afssyscalls.h: afssyscalls.h
201         ${INSTALL} $? $@
202
203 ${DESTDIR}${bindir}/pagsh: pagsh
204         ${INSTALL} -s $? $@
205
206 ${DESTDIR}${bindir}/pagsh.krb: pagsh.krb
207         ${INSTALL} -s $? $@
208
209 ${DESTDIR}${includedir}/afs/afs.exp: afs.exp
210         ${INSTALL} $? $@
211
212 ${DESTDIR}${includedir}/afs/xfsattrs.h: xfsattrs.h
213         ${INSTALL} $? $@
214
215 dest: \
216         ${DEST}/lib/afs/libsys.a \
217         ${DEST}/etc/rmtsysd \
218         ${DEST}/bin/pagsh \
219         ${DEST}/bin/pagsh.krb \
220         ${DEST}/include/afs/afssyscalls.h \
221         ${DEST}/include/afs/afs.exp \
222         ${DEST}/include/afs/xfsattrs.h
223
224 ${DEST}/lib/afs/libsys.a: libsys.a
225         ${INSTALL} $? $@
226
227 ${DEST}/include/afs/afs.exp: afs.exp
228         ${INSTALL} $? $@
229
230 ${DEST}/include/afs/xfsattrs.h: xfsattrs.h
231         ${INSTALL} $? $@
232
233 ${DEST}/include/afs/afssyscalls.h: afssyscalls.h
234         ${INSTALL} $? $@
235
236 ${DEST}/etc/rmtsysd: rmtsysd
237         ${INSTALL} -s $? $@
238
239 ${DEST}/bin/pagsh: pagsh
240         ${INSTALL} -s $? $@
241
242 ${DEST}/bin/pagsh.krb: pagsh.krb
243         ${INSTALL} -s $? $@
244
245 #
246 # Misc targets
247 #
248 include ../config/Makefile.version
249
250 clean:
251         $(RM) -f *.o libsys.a xfsinode iinc idec icreate iopen istat core \
252         rmtsysc rmtsyss *.o rmtsys.ss.c rmtsys.cs.c rmtsys.xdr.c rmtsys.h \
253         rmtsysd AFS_component_version_number.c pagsh pagsh.krb