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