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