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