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