generated file target
[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 generated: \
30         utst_int.cs.c utst_int.ss.c utst_int.xdr.c utst_int.h \
31         Kubik_int.cs.c Kubik_int.xdr.c Kubik_int.h \
32         ubik_int.cs.c ubik_int.ss.c ubik_int.xdr.c ubik_int.h \
33         uerrors.c ubik.h
34
35 depinstall: \
36         ubik_int.cs.c ubik_int.xdr.c \
37         ${TOP_INCDIR}/ubik.h \
38         ${TOP_INCDIR}/ubik_int.h
39
40 ${TOP_LIBDIR}/libubik.a: libubik.a
41         ${INSTALL_DATA} $? $@
42
43 ${TOP_INCDIR}/ubik.h: ubik.h
44         ${INSTALL_DATA} $? $@
45
46 ${TOP_INCDIR}/ubik_int.h: ubik_int.h
47         ${INSTALL_DATA} $? $@
48
49 utst_server: utst_server.o utst_int.ss.o utst_int.xdr.o libubik.a 
50         ${CC} ${CFLAGS} -o utst_server utst_server.o utst_int.ss.o utst_int.xdr.o libubik.a $(LIBS)
51
52 utst_client: utst_client.o utst_int.cs.o utst_int.xdr.o libubik.a 
53         ${CC} ${CFLAGS} -o utst_client utst_client.o utst_int.cs.o utst_int.xdr.o libubik.a $(LIBS)
54
55 udebug: udebug.o libubik.a 
56         ${CC} ${CFLAGS} -o udebug udebug.o libubik.a $(LIBS)
57
58 ubik_int.cs.c: ubik_int.xg
59         ${RXGEN} -A -x -C -o $@ ${srcdir}/ubik_int.xg
60
61 ubik_int.ss.c: ubik_int.xg
62         ${RXGEN} -A -x -S -o $@ ${srcdir}/ubik_int.xg
63
64 ubik_int.xdr.c: ubik_int.xg
65         ${RXGEN} -A -x -c -o $@ ${srcdir}/ubik_int.xg
66
67 ubik_int.h: ubik_int.xg
68         ${RXGEN} -A -x -h -o $@ ${srcdir}/ubik_int.xg
69
70 ubik_int.cs.c: ubik_int.h
71 ubik_int.ss.c: ubik_int.h
72 ubik_int.xdr.c: ubik_int.h
73
74 Kubik_int.cs.c: ubik_int.xg Kubik_int.h
75         ${RXGEN} -A -x -k -C -o Kubik_int.cs.c ${srcdir}/ubik_int.xg
76
77 Kubik_int.xdr.c: ubik_int.xg
78         ${RXGEN} -A -x -k -c -o Kubik_int.xdr.c ${srcdir}/ubik_int.xg
79
80 Kubik_int.h: ubik_int.xg
81         ${RXGEN} -A -x -k -h -o Kubik_int.h ${srcdir}/ubik_int.xg
82
83 utst_int.ss.o: utst_int.ss.c utst_int.xdr.c
84 utst_int.cs.o: utst_int.cs.c utst_int.xdr.c
85 utst_int.xdr.o: utst_int.xdr.c utst_int.h
86
87 utst_int.cs.c: utst_int.xg
88         ${RXGEN} -A -C -u -o $@ ${srcdir}/utst_int.xg
89
90 utst_int.ss.c: utst_int.xg
91         ${RXGEN} -A -S -o $@ ${srcdir}/utst_int.xg
92
93 utst_int.xdr.c: utst_int.xg
94         ${RXGEN} -A -c -o $@ ${srcdir}/utst_int.xg
95
96 utst_int.h: utst_int.xg
97         ${RXGEN} -A -h -u -o $@ ${srcdir}/utst_int.xg
98
99 utst_int.cs.c: utst_int.h
100 utst_int.ss.c: utst_int.h
101 utst_int.xdr.c: utst_int.h
102
103 utst_server.o: utst_server.c ${INCLS} utst_int.h AFS_component_version_number.c
104 utst_client.o: utst_client.c ${INCLS} utst_int.h AFS_component_version_number.c
105
106 udebug.o: udebug.c ${INCLS} AFS_component_version_number.c
107         ${CC} ${CFLAGS} -I${TOP_INCDIR} -I${TOP_INCDIR}/afs -c ${srcdir}/udebug.c
108
109 uerrors.o: uerrors.c
110
111 uerrors.c ubik.h: uerrors.et ubik.p.h
112         $(RM) -f ubik.h uerrors.c
113         ${COMPILE_ET} -p ${srcdir} uerrors -h ubik
114
115 libubik.a: ${LIBOBJS} AFS_component_version_number.o
116         -$(RM) -f $@
117         $(AR) crc $@ ${LIBOBJS} AFS_component_version_number.o
118         $(RANLIB) $@
119
120 disk.o: disk.c ${INCLS}
121 uinit.o: uinit.c ${INCLS}
122 remote.o: remote.c ${INCLS}
123
124 # beacon.c uses signed and unsigned interchangably for IP addresses. Fixing
125 # will require changing the Ubik API
126 beacon.o: beacon.c ${INCLS}
127         $(CC) $(CFLAGS) @CFLAGS_NOERROR@ -c $<
128
129 lock.o: lock.c ${INCLS}
130 recovery.o: recovery.c ${INCLS}
131 ubik.o: ubik.c ${INCLS}
132 phys.o: phys.c ${INCLS}
133 vote.o: vote.c ${INCLS}
134 ubikcmd.o: ubikcmd.c ${INCLS}
135 ubikclient.o: ubikclient.c ${INCLS}
136 ubik_int.ss.o: ubik_int.ss.c ${INCLS}
137 ubik_int.cs.o: ubik_int.cs.c ${INCLS}
138 ubik_int.xdr.o: ubik_int.xdr.c ${INCLS}
139 utst_int.ss.o: utst_int.ss.c ${INCLS} utst_int.h
140 utst_int.cs.o: utst_int.cs.c ${INCLS} utst_int.h
141 utst_int.xdr.o: utst_int.xdr.c ${INCLS} utst_int.h 
142
143 #
144 # Installation targets
145 #
146 test: all
147
148 install: libubik.a ubik.h ubik_int.h udebug
149         ${INSTALL} -d ${DESTDIR}${libdir}
150         ${INSTALL} -d ${DESTDIR}${includedir}
151         ${INSTALL} -d ${DESTDIR}${bindir}
152         ${INSTALL} -d ${DESTDIR}${afssrvbindir}
153         ${INSTALL_DATA} libubik.a ${DESTDIR}${libdir}/libubik.a
154         ${INSTALL_DATA} ubik.h ${DESTDIR}${includedir}/ubik.h
155         ${INSTALL_DATA} ubik_int.h ${DESTDIR}${includedir}/ubik_int.h
156         ${INSTALL_PROGRAM} udebug ${DESTDIR}${bindir}/udebug
157         ${INSTALL_PROGRAM} udebug ${DESTDIR}${afssrvbindir}/udebug
158
159 dest: libubik.a ubik.h ubik_int.h udebug
160         ${INSTALL} -d ${DEST}/lib
161         ${INSTALL} -d ${DEST}/include
162         ${INSTALL} -d ${DEST}/root.server/usr/afs/bin
163         ${INSTALL_DATA} libubik.a ${DEST}/lib/libubik.a
164         ${INSTALL_DATA} ubik.h ${DEST}/include/ubik.h
165         ${INSTALL_DATA} ubik_int.h ${DEST}/include/ubik_int.h
166         ${INSTALL_PROGRAM} udebug ${DEST}/bin/udebug
167         ${INSTALL_PROGRAM} udebug ${DEST}/root.server/usr/afs/bin/udebug
168
169 #
170 # Misc. targets
171 #
172 clean:
173         $(RM) -f *.o utst_server utst_client udebug *.a *.cs.c *.ss.c *.xdr.c
174         $(RM) -f utst_int.h ubik_int.h uerrors.c ubik.h core AFS_component_version_number.c Kubik_int.h
175
176 include ../config/Makefile.version