Initial OpenBSD support. Most of user space builds. No kernel module yet.
[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 prefix=@prefix@
12 exec_prefix=@exec_prefix@
13 bindir=@bindir@
14 sbindir=@sbindir@
15 libexecdir=@libexecdir@
16 libdir=@libdir@
17 includedir=@includedir@
18 mandir=@mandir@
19 afssrvbindir=@afssrvbindir@
20 afssrvsbindir=@afssrvsbindir@
21 afssrvlibexecdir=@afssrvlibexecdir@
22 TOP_SRCDIR=@TOP_SRCDIR@
23 SYS_NAME=@AFS_SYSNAME@
24
25 SHELL = /bin/sh
26
27 include ../config/Makefile.${SYS_NAME}
28
29 CFLAGS=${OPTMZ} -I${TOP_SRCDIR}/config -I. -I${TOP_INCDIR} ${XCFLAGS}
30 UKERNELDIR=../libuafs/
31
32 LIBOBJS=disk.o  remote.o beacon.o recovery.o ubik.o  vote.o lock.o phys.o \
33         ubik_int.cs.o ubik_int.ss.o ubik_int.xdr.o ubikcmd.o \
34         ubikclient.o uerrors.o
35
36 INCLS=${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/lock.h \
37         ${TOP_INCDIR}/rx/rx.h ${TOP_INCDIR}/rx/xdr.h \
38         ${TOP_INCDIR}/lock.h ubik.h ubik_int.h
39
40 LIBS=${TOP_LIBDIR}/librx.a ${TOP_LIBDIR}/liblwp.a \
41      ${TOP_LIBDIR}/libcom_err.a ${TOP_LIBDIR}/libcmd.a \
42      ${TOP_LIBDIR}/util.a ${TOP_LIBDIR}/libsys.a ${XLIBS}
43
44 RXGEN=${TOP_SRCDIR}/rxgen/rxgen
45 COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et
46
47 all: ukinstall ${TOP_LIBDIR}/libubik.a ${TOP_INCDIR}/ubik.h ${TOP_INCDIR}/ubik_int.h udebug utst_server utst_client
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.ss.c ubik_int.cs.c ubik_int.xdr.c ubik_int.h: ubik_int.xg
59         ${RXGEN} -x ubik_int.xg
60
61 Kubik_int.cs.c: ubik_int.xg Kubik_int.h
62         ${RXGEN} -x -k -C -o Kubik_int.cs.c ubik_int.xg
63  
64 Kubik_int.xdr.c: ubik_int.xg
65         ${RXGEN} -x -k -c -o Kubik_int.xdr.c ubik_int.xg
66  
67 Kubik_int.h: ubik_int.xg
68         ${RXGEN} -x -k -h -o Kubik_int.h ubik_int.xg
69
70 utst_int.ss.o: utst_int.ss.c utst_int.xdr.c
71 utst_int.cs.o: utst_int.cs.c utst_int.xdr.c
72 utst_int.xdr.o: utst_int.xdr.c utst_int.h
73 utst_int.ss.c utst_int.cs.c utst_int.xdr.c utst_int.h: utst_int.xg
74         ${RXGEN} utst_int.xg
75
76 utst_server.o: utst_server.c ${INCLS} utst_int.h AFS_component_version_number.c
77 utst_client.o: utst_client.c ${INCLS} utst_int.h AFS_component_version_number.c
78
79 udebug.o: udebug.c ${INCLS} AFS_component_version_number.c
80         ${CC} ${CFLAGS} -g -I. -I${TOP_INCDIR} -I${TOP_INCDIR}/afs -c udebug.c
81
82 uerrors.o: uerrors.c
83
84 uerrors.c ubik.h: uerrors.et ubik.p.h
85         $(RM) -f ubik.h uerrors.c
86         ${COMPILE_ET} uerrors -h ubik
87
88 libubik.a: ${LIBOBJS} AFS_component_version_number.o
89         -$(RM) -f $@
90         $(AR) crc $@ ${LIBOBJS} AFS_component_version_number.o
91         $(RANLIB) $@
92
93 disk.o: disk.c ${INCLS}
94 remote.o: remote.c ${INCLS}
95 beacon.o: beacon.c ${INCLS}
96 lock.o: lock.c ${INCLS}
97 recovery.o: recovery.c ${INCLS}
98 ubik.o: ubik.c ${INCLS}
99 phys.o: phys.c ${INCLS}
100 vote.o: vote.c ${INCLS}
101 ubikcmd.o: ubikcmd.c ${INCLS}
102 ubikclient.o: ubikclient.c ${INCLS}
103 ubik_int.ss.o: ubik_int.ss.c ${INCLS}
104 ubik_int.cs.o: ubik_int.cs.c ${INCLS}
105 ubik_int.xdr.o: ubik_int.xdr.c ${INCLS}
106 utst_int.ss.o: utst_int.ss.c ${INCLS} utst_int.h
107 utst_int.cs.o: utst_int.cs.c ${INCLS} utst_int.h
108 utst_int.xdr.o: utst_int.xdr.c ${INCLS} utst_int.h 
109
110 #
111 # Installation targets
112 #
113 test: all
114
115 install: \
116         ${DESTDIR}${libdir}/libubik.a \
117         ${DESTDIR}${includedir}/ubik.h \
118         ${DESTDIR}${includedir}/ubik_int.h \
119         ${DESTDIR}${bindir}/udebug \
120         ${DESTDIR}${afssrvbindir}/udebug
121
122 ${DEST}/bin/udebug ${DEST}/root.server/usr/afs/bin/udebug: udebug
123         ${INSTALL} $? $@
124
125 ${DEST}/lib/libubik.a: libubik.a
126         ${INSTALL} $? $@
127
128 ${DEST}/include/ubik.h: ubik.h
129         ${INSTALL} $? $@
130
131 ${DEST}/include/ubik_int.h: ubik_int.h
132         ${INSTALL} $? $@
133
134 ukinstall: ${UKERNELDIR}/afs ${UKERNELDIR}/afsint \
135         ${UKERNELDIR}/afsint/ubik_int.h \
136         ${UKERNELDIR}/afsint/ubik_int.cs.c \
137         ${UKERNELDIR}/afsint/ubik_int.xdr.c \
138         ${UKERNELDIR}/afs/ubik.h \
139         ${UKERNELDIR}/afs/ubikclient.c \
140         ${UKERNELDIR}/afs/uerrors.c
141
142 ${UKERNELDIR}/afs:
143         mkdir -p $@
144
145 ${UKERNELDIR}/afsint:
146         mkdir -p $@
147
148 ${UKERNELDIR}/afsint/ubik_int.h: Kubik_int.h
149         ${INSTALL} $? $@
150
151 ${UKERNELDIR}/afsint/ubik_int.cs.c: Kubik_int.cs.c
152         ${INSTALL} $? $@
153
154 ${UKERNELDIR}/afsint/ubik_int.xdr.c: Kubik_int.xdr.c
155         ${INSTALL} $? $@
156
157 ${UKERNELDIR}/afs/ubik.h: ubik.h
158         ${INSTALL} $? $@
159
160 ${UKERNELDIR}/afs/ubikclient.c: ubikclient.c
161         ${INSTALL} $? $@
162
163 ${UKERNELDIR}/afs/uerrors.c: uerrors.c
164         ${INSTALL} $? $@
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
174
175
176 ${DESTDIR}${libdir}/libubik.a: libubik.a
177         ${INSTALL} $? $@
178
179 ${TOP_LIBDIR}/libubik.a: libubik.a
180         ${INSTALL} $? $@
181
182 ${DESTDIR}${includedir}/ubik.h: ubik.h
183         ${INSTALL} $? $@
184
185 ${TOP_INCDIR}/ubik.h: ubik.h
186         ${INSTALL} $? $@
187
188 ${DESTDIR}${includedir}/ubik_int.h: ubik_int.h
189         ${INSTALL} $? $@
190
191 ${TOP_INCDIR}/ubik_int.h: ubik_int.h
192         ${INSTALL} $? $@
193
194 ${DESTDIR}${bindir}/udebug: udebug
195         ${INSTALL} $? $@
196
197 ${DESTDIR}${afssrvbindir}/udebug: udebug
198         ${INSTALL} $? $@
199
200 dest: \
201         ${DEST}/lib/libubik.a \
202         ${DEST}/include/ubik.h \
203         ${DEST}/include/ubik_int.h \
204         ${DEST}/bin/udebug \
205         ${DEST}/root.server/usr/afs/bin/udebug
206