makefiles-attempt-to-support-gmake-j-20011023
[openafs.git] / src / ubik / 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 DEST=@DEST@
9 TOP_INCDIR=@TOP_INCDIR@
10 TOP_LIBDIR=@TOP_LIBDIR@
11 TOP_OBJDIR=@TOP_OBJDIR@
12 srcdir=@srcdir@
13 VPATH=${srcdir}
14 prefix=@prefix@
15 exec_prefix=@exec_prefix@
16 bindir=@bindir@
17 sbindir=@sbindir@
18 libexecdir=@libexecdir@
19 libdir=@libdir@
20 includedir=@includedir@
21 mandir=@mandir@
22 afssrvbindir=@afssrvbindir@
23 afssrvsbindir=@afssrvsbindir@
24 afssrvlibexecdir=@afssrvlibexecdir@
25 TOP_SRCDIR=@TOP_SRCDIR@
26 SYS_NAME=@AFS_SYSNAME@
27
28 SHELL = /bin/sh
29
30 include ../config/Makefile.${SYS_NAME}
31
32 CFLAGS=-I. -I${srcdir} ${OPTMZ} -I${TOP_OBJDIR}/src/config -I. -I${TOP_INCDIR} ${XCFLAGS}
33 UKERNELDIR=../libuafs/
34
35 LIBOBJS=disk.o  remote.o beacon.o recovery.o ubik.o  vote.o lock.o phys.o \
36         ubik_int.cs.o ubik_int.ss.o ubik_int.xdr.o ubikcmd.o \
37         ubikclient.o uerrors.o
38
39 INCLS=${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/lock.h \
40         ${TOP_INCDIR}/rx/rx.h ${TOP_INCDIR}/rx/xdr.h \
41         ${TOP_INCDIR}/lock.h ubik.h ubik_int.h
42
43 LIBS=${TOP_LIBDIR}/librx.a ${TOP_LIBDIR}/liblwp.a \
44      ${TOP_LIBDIR}/libcom_err.a ${TOP_LIBDIR}/libcmd.a \
45      ${TOP_LIBDIR}/util.a ${TOP_LIBDIR}/libsys.a ${XLIBS}
46
47 RXGEN=${TOP_OBJDIR}/src/rxgen/rxgen
48 COMPILE_ET=${TOP_OBJDIR}/src/comerr/compile_et
49
50 all: ukinstall ${TOP_LIBDIR}/libubik.a ${TOP_INCDIR}/ubik.h ${TOP_INCDIR}/ubik_int.h udebug utst_server utst_client
51
52 utst_server: utst_server.o utst_int.ss.o utst_int.xdr.o libubik.a 
53         ${CC} ${CFLAGS} -o utst_server utst_server.o utst_int.ss.o utst_int.xdr.o libubik.a $(LIBS)
54
55 utst_client: utst_client.o utst_int.cs.o utst_int.xdr.o libubik.a 
56         ${CC} ${CFLAGS} -o utst_client utst_client.o utst_int.cs.o utst_int.xdr.o libubik.a $(LIBS)
57
58 udebug: udebug.o libubik.a 
59         ${CC} ${CFLAGS} -o udebug udebug.o libubik.a $(LIBS)
60
61 ubik_int.cs.c: ubik_int.xg
62         ${RXGEN} -x -C -o $@ ${srcdir}/ubik_int.xg
63
64 ubik_int.ss.c: ubik_int.xg
65         ${RXGEN} -x -S -o $@ ${srcdir}/ubik_int.xg
66
67 ubik_int.xdr.c: ubik_int.xg
68         ${RXGEN} -x -c -o $@ ${srcdir}/ubik_int.xg
69
70 ubik_int.h: ubik_int.xg
71         ${RXGEN} -x -h -o $@ ${srcdir}/ubik_int.xg
72
73 ubik_int.cs.c: ubik_int.h
74 ubik_int.ss.c: ubik_int.h
75 ubik_int.xdr.c: ubik_int.h
76
77 Kubik_int.cs.c: ubik_int.xg Kubik_int.h
78         ${RXGEN} -x -k -C -o Kubik_int.cs.c ${srcdir}/ubik_int.xg
79  
80 Kubik_int.xdr.c: ubik_int.xg
81         ${RXGEN} -x -k -c -o Kubik_int.xdr.c ${srcdir}/ubik_int.xg
82  
83 Kubik_int.h: ubik_int.xg
84         ${RXGEN} -x -k -h -o Kubik_int.h ${srcdir}/ubik_int.xg
85
86 utst_int.ss.o: utst_int.ss.c utst_int.xdr.c
87 utst_int.cs.o: utst_int.cs.c utst_int.xdr.c
88 utst_int.xdr.o: utst_int.xdr.c utst_int.h
89
90 utst_int.cs.c: utst_int.xg
91         ${RXGEN} -C -o $@ ${srcdir}/utst_int.xg
92
93 utst_int.ss.c: utst_int.xg
94         ${RXGEN} -S -o $@ ${srcdir}/utst_int.xg
95
96 utst_int.xdr.c: utst_int.xg
97         ${RXGEN} -c -o $@ ${srcdir}/utst_int.xg
98
99 utst_int.h: utst_int.xg
100         ${RXGEN} -h -o $@ ${srcdir}/utst_int.xg
101
102 utst_int.cs.c: utst_int.h
103 utst_int.ss.c: utst_int.h
104 utst_int.xdr.c: utst_int.h
105
106 utst_server.o: utst_server.c ${INCLS} utst_int.h AFS_component_version_number.c
107 utst_client.o: utst_client.c ${INCLS} utst_int.h AFS_component_version_number.c
108
109 udebug.o: udebug.c ${INCLS} AFS_component_version_number.c
110         ${CC} ${CFLAGS} -g -I. -I${TOP_INCDIR} -I${TOP_INCDIR}/afs -c ${srcdir}/udebug.c
111
112 uerrors.o: uerrors.c
113
114 uerrors.c ubik.h: uerrors.et ubik.p.h
115         $(RM) -f ubik.h uerrors.c
116         ${COMPILE_ET} -p ${srcdir} uerrors -h ubik
117
118 libubik.a: ${LIBOBJS} AFS_component_version_number.o
119         -$(RM) -f $@
120         $(AR) crc $@ ${LIBOBJS} AFS_component_version_number.o
121         $(RANLIB) $@
122
123 disk.o: disk.c ${INCLS}
124 remote.o: remote.c ${INCLS}
125 beacon.o: beacon.c ${INCLS}
126 lock.o: lock.c ${INCLS}
127 recovery.o: recovery.c ${INCLS}
128 ubik.o: ubik.c ${INCLS}
129 phys.o: phys.c ${INCLS}
130 vote.o: vote.c ${INCLS}
131 ubikcmd.o: ubikcmd.c ${INCLS}
132 ubikclient.o: ubikclient.c ${INCLS}
133 ubik_int.ss.o: ubik_int.ss.c ${INCLS}
134 ubik_int.cs.o: ubik_int.cs.c ${INCLS}
135 ubik_int.xdr.o: ubik_int.xdr.c ${INCLS}
136 utst_int.ss.o: utst_int.ss.c ${INCLS} utst_int.h
137 utst_int.cs.o: utst_int.cs.c ${INCLS} utst_int.h
138 utst_int.xdr.o: utst_int.xdr.c ${INCLS} utst_int.h 
139
140 #
141 # Installation targets
142 #
143 test: all
144
145 install: \
146         ${DESTDIR}${libdir}/libubik.a \
147         ${DESTDIR}${includedir}/ubik.h \
148         ${DESTDIR}${includedir}/ubik_int.h \
149         ${DESTDIR}${bindir}/udebug \
150         ${DESTDIR}${afssrvbindir}/udebug
151
152 ${DEST}/bin/udebug ${DEST}/root.server/usr/afs/bin/udebug: udebug
153         ${INSTALL} $? $@
154
155 ${DEST}/lib/libubik.a: libubik.a
156         ${INSTALL} $? $@
157
158 ${DEST}/include/ubik.h: ubik.h
159         ${INSTALL} $? $@
160
161 ${DEST}/include/ubik_int.h: ubik_int.h
162         ${INSTALL} $? $@
163
164 ukinstall: ${UKERNELDIR}/afs ${UKERNELDIR}/afsint \
165         ${UKERNELDIR}/afsint/ubik_int.h \
166         ${UKERNELDIR}/afsint/ubik_int.cs.c \
167         ${UKERNELDIR}/afsint/ubik_int.xdr.c \
168         ${UKERNELDIR}/afs/ubik.h \
169         ${UKERNELDIR}/afs/ubikclient.c \
170         ${UKERNELDIR}/afs/uerrors.c
171
172 ${UKERNELDIR}/afs:
173         mkdir -p $@
174
175 ${UKERNELDIR}/afsint:
176         mkdir -p $@
177
178 ${UKERNELDIR}/afsint/ubik_int.h: Kubik_int.h
179         ${INSTALL} $? $@
180
181 ${UKERNELDIR}/afsint/ubik_int.cs.c: Kubik_int.cs.c
182         ${INSTALL} $? $@
183
184 ${UKERNELDIR}/afsint/ubik_int.xdr.c: Kubik_int.xdr.c
185         ${INSTALL} $? $@
186
187 ${UKERNELDIR}/afs/ubik.h: ubik.h
188         ${INSTALL} $? $@
189
190 ${UKERNELDIR}/afs/ubikclient.c: ubikclient.c
191         ${INSTALL} $? $@
192
193 ${UKERNELDIR}/afs/uerrors.c: uerrors.c
194         ${INSTALL} $? $@
195
196 #
197 # Misc. targets
198 #
199 clean:
200         $(RM) -f *.o utst_server utst_client udebug *.a *.cs.c *.ss.c *.xdr.c
201         $(RM) -f utst_int.h ubik_int.h uerrors.c ubik.h core AFS_component_version_number.c Kubik_int.h
202
203 include ../config/Makefile.version
204
205
206 ${DESTDIR}${libdir}/libubik.a: libubik.a
207         ${INSTALL} $? $@
208
209 ${TOP_LIBDIR}/libubik.a: libubik.a
210         ${INSTALL} $? $@
211
212 ${DESTDIR}${includedir}/ubik.h: ubik.h
213         ${INSTALL} $? $@
214
215 ${TOP_INCDIR}/ubik.h: ubik.h
216         ${INSTALL} $? $@
217
218 ${DESTDIR}${includedir}/ubik_int.h: ubik_int.h
219         ${INSTALL} $? $@
220
221 ${TOP_INCDIR}/ubik_int.h: ubik_int.h
222         ${INSTALL} $? $@
223
224 ${DESTDIR}${bindir}/udebug: udebug
225         ${INSTALL} $? $@
226
227 ${DESTDIR}${afssrvbindir}/udebug: udebug
228         ${INSTALL} $? $@
229
230 dest: \
231         ${DEST}/lib/libubik.a \
232         ${DEST}/include/ubik.h \
233         ${DEST}/include/ubik_int.h \
234         ${DEST}/bin/udebug \
235         ${DEST}/root.server/usr/afs/bin/udebug
236