6b8fe7494d69a99e69764a9fb5d66e884d758f55
[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 include @TOP_OBJDIR@/src/config/Makefile.lwp
11
12 INSTALL = @INSTALL@
13 INSTALL_DATA = @INSTALL_DATA@
14 INSTALL_PROGRAM = @INSTALL_PROGRAM@
15 INSTALL_SCRIPT = @INSTALL_SCRIPT@
16
17 LIBOBJS=disk.o  remote.o beacon.o recovery.o ubik.o  vote.o lock.o phys.o \
18         ubik_int.cs.o ubik_int.ss.o ubik_int.xdr.o ubikcmd.o \
19         ubikclient.o uerrors.o uinit.o
20
21 INCLS=${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/lock.h \
22         ${TOP_INCDIR}/rx/rx.h ${TOP_INCDIR}/rx/xdr.h \
23         ${TOP_INCDIR}/lock.h ubik.h ubik_int.h
24
25 LIBS=${TOP_LIBDIR}/librx.a ${TOP_LIBDIR}/liblwp.a \
26      ${TOP_LIBDIR}/libcom_err.a ${TOP_LIBDIR}/libcmd.a \
27      ${TOP_LIBDIR}/util.a ${TOP_LIBDIR}/libsys.a ${XLIBS}
28
29 all: depinstall ${TOP_LIBDIR}/libubik.a udebug utst_server utst_client
30
31 generated: \
32         utst_int.cs.c utst_int.ss.c utst_int.xdr.c utst_int.h \
33         Kubik_int.cs.c Kubik_int.xdr.c Kubik_int.h \
34         ubik_int.cs.c ubik_int.ss.c ubik_int.xdr.c ubik_int.h \
35         uerrors.c ubik.h
36
37 depinstall: \
38         ubik_int.cs.c ubik_int.xdr.c \
39         ${TOP_INCDIR}/ubik.h \
40         ${TOP_INCDIR}/ubik_int.h
41
42 ${TOP_LIBDIR}/libubik.a: libubik.a
43         ${INSTALL_DATA} $? $@
44
45 ${TOP_INCDIR}/ubik.h: ubik.h
46         ${INSTALL_DATA} $? $@
47
48 ${TOP_INCDIR}/ubik_int.h: ubik_int.h
49         ${INSTALL_DATA} $? $@
50
51 utst_server: utst_server.o utst_int.ss.o utst_int.xdr.o libubik.a 
52         $(AFS_LDRULE) utst_server.o utst_int.ss.o utst_int.xdr.o \
53                 libubik.a $(LIBS) $(LIB_roken)
54
55 utst_client: utst_client.o utst_int.cs.o utst_int.xdr.o libubik.a 
56         $(AFS_LDRULE) utst_client.o utst_int.cs.o utst_int.xdr.o \
57                 libubik.a $(LIBS) $(LIB_roken)
58
59 udebug: udebug.o libubik.a 
60         $(AFS_LDRULE) udebug.o libubik.a $(LIBS) $(LIB_roken)
61
62 ubik_int.cs.c: ubik_int.xg
63         ${RXGEN} -A -x -C -o $@ ${srcdir}/ubik_int.xg
64
65 ubik_int.ss.c: ubik_int.xg
66         ${RXGEN} -A -x -S -o $@ ${srcdir}/ubik_int.xg
67
68 ubik_int.xdr.c: ubik_int.xg
69         ${RXGEN} -A -x -c -o $@ ${srcdir}/ubik_int.xg
70
71 ubik_int.h: ubik_int.xg
72         ${RXGEN} -A -x -h -o $@ ${srcdir}/ubik_int.xg
73
74 ubik_int.cs.c: ubik_int.h
75 ubik_int.ss.c: ubik_int.h
76 ubik_int.xdr.c: ubik_int.h
77
78 Kubik_int.cs.c: ubik_int.xg Kubik_int.h
79         ${RXGEN} -A -x -k -C -o Kubik_int.cs.c ${srcdir}/ubik_int.xg
80
81 Kubik_int.xdr.c: ubik_int.xg
82         ${RXGEN} -A -x -k -c -o Kubik_int.xdr.c ${srcdir}/ubik_int.xg
83
84 Kubik_int.h: ubik_int.xg
85         ${RXGEN} -A -x -k -h -o Kubik_int.h ${srcdir}/ubik_int.xg
86
87 utst_int.ss.o: utst_int.ss.c utst_int.xdr.c
88 utst_int.cs.o: utst_int.cs.c utst_int.xdr.c
89 utst_int.xdr.o: utst_int.xdr.c utst_int.h
90
91 utst_int.cs.c: utst_int.xg
92         ${RXGEN} -A -C -u -o $@ ${srcdir}/utst_int.xg
93
94 utst_int.ss.c: utst_int.xg
95         ${RXGEN} -A -S -o $@ ${srcdir}/utst_int.xg
96
97 utst_int.xdr.c: utst_int.xg
98         ${RXGEN} -A -c -o $@ ${srcdir}/utst_int.xg
99
100 utst_int.h: utst_int.xg
101         ${RXGEN} -A -h -u -o $@ ${srcdir}/utst_int.xg
102
103 utst_int.cs.c: utst_int.h
104 utst_int.ss.c: utst_int.h
105 utst_int.xdr.c: utst_int.h
106
107 utst_server.o: utst_server.c ${INCLS} utst_int.h AFS_component_version_number.c
108 utst_client.o: utst_client.c ${INCLS} utst_int.h AFS_component_version_number.c
109
110 udebug.o: udebug.c ${INCLS} AFS_component_version_number.c
111 uerrors.o: uerrors.c
112
113 uerrors.c ubik.h: uerrors.et ubik.p.h
114         $(RM) -f ubik.h uerrors.c
115         ${COMPILE_ET} -p ${srcdir} uerrors -h ubik
116
117 libubik.a: ${LIBOBJS} AFS_component_version_number.o
118         -$(RM) -f $@
119         $(AR) crc $@ ${LIBOBJS} AFS_component_version_number.o
120         $(RANLIB) $@
121
122 disk.o: disk.c ${INCLS}
123 uinit.o: uinit.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: libubik.a ubik.h ubik_int.h udebug
146         ${INSTALL} -d ${DESTDIR}${libdir}
147         ${INSTALL} -d ${DESTDIR}${includedir}
148         ${INSTALL} -d ${DESTDIR}${bindir}
149         ${INSTALL} -d ${DESTDIR}${afssrvbindir}
150         ${INSTALL_DATA} libubik.a ${DESTDIR}${libdir}/libubik.a
151         ${INSTALL_DATA} ubik.h ${DESTDIR}${includedir}/ubik.h
152         ${INSTALL_DATA} ubik_int.h ${DESTDIR}${includedir}/ubik_int.h
153         ${INSTALL_PROGRAM} udebug ${DESTDIR}${bindir}/udebug
154         ${INSTALL_PROGRAM} udebug ${DESTDIR}${afssrvbindir}/udebug
155
156 dest: libubik.a ubik.h ubik_int.h udebug
157         ${INSTALL} -d ${DEST}/lib
158         ${INSTALL} -d ${DEST}/include
159         ${INSTALL} -d ${DEST}/root.server/usr/afs/bin
160         ${INSTALL_DATA} libubik.a ${DEST}/lib/libubik.a
161         ${INSTALL_DATA} ubik.h ${DEST}/include/ubik.h
162         ${INSTALL_DATA} ubik_int.h ${DEST}/include/ubik_int.h
163         ${INSTALL_PROGRAM} udebug ${DEST}/bin/udebug
164         ${INSTALL_PROGRAM} udebug ${DEST}/root.server/usr/afs/bin/udebug
165
166 #
167 # Misc. targets
168 #
169 clean:
170         $(RM) -f *.o utst_server utst_client udebug *.a *.cs.c *.ss.c *.xdr.c
171         $(RM) -f utst_int.h ubik_int.h uerrors.c ubik.h core AFS_component_version_number.c Kubik_int.h
172
173 include ../config/Makefile.version