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