tvolser-default-20040809
[openafs.git] / src / volser / 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 HELPER_SPLINT=@HELPER_SPLINT@
11
12
13 VINCLS=${TOP_INCDIR}/afs/partition.h ${TOP_INCDIR}/afs/volume.h \
14         ${TOP_INCDIR}/afs/vlserver.h vol.h dump.h volser.h  lockdata.h
15
16 RINCLS=${TOP_INCDIR}/rx/rx.h ${TOP_INCDIR}/rx/xdr.h \
17        ${TOP_INCDIR}/afs/keys.h ${TOP_INCDIR}/afs/cellconfig.h \
18         ${TOP_INCDIR}/ubik.h ${TOP_INCDIR}/afs/cmd.h
19
20 INTINCLS=volint.h volser.h 
21
22 LIBS=\
23         ${TOP_LIBDIR}/libaudit.a \
24         ${TOP_LIBDIR}/vlib.a \
25         ${TOP_LIBDIR}/libacl.a \
26         ${TOP_LIBDIR}/libsys.a \
27         ${TOP_LIBDIR}/libvldb.a \
28         ${TOP_LIBDIR}/libubik.a \
29         ${TOP_LIBDIR}/libauth.a \
30         ${TOP_LIBDIR}/libcmd.a \
31         ${TOP_LIBDIR}/librxkad.a \
32         ${TOP_LIBDIR}/libdes.a \
33         ${TOP_LIBDIR}/librxstat.a \
34         ${TOP_LIBDIR}/librx.a \
35         ${TOP_LIBDIR}/liblwp.a \
36         ${TOP_LIBDIR}/libsys.a \
37         ${TOP_LIBDIR}/libcom_err.a \
38         ${TOP_LIBDIR}/libkauth.a \
39         ${TOP_LIBDIR}/libusd.a \
40         ${TOP_LIBDIR}/util.a
41
42 VOLDUMP_LIBS = \
43         ../vol/ihandle.o \
44         ../vol/physio.o \
45         ../vol/vlib.a \
46         ${TOP_LIBDIR}/libcmd.a \
47         ${TOP_LIBDIR}/util.a \
48         ${TOP_LIBDIR}/libsys.a \
49         ${TOP_LIBDIR}/libdir.a \
50         ${TOP_LIBDIR}/liblwp.a  \
51         ${TOP_LIBDIR}/libacl.a
52
53 VSOBJS=vsprocs.o vsutils.o lockprocs.o volint.xdr.o volerr.o 
54 SOBJS=volmain.o volprocs.o physio.o common.o voltrans.o volerr.o \
55  volint.cs.o dumpstuff.o volint.ss.o volint.xdr.o
56
57 all: volserver vos restorevol voldump \
58         ${TOP_INCDIR}/afs/volser.h \
59         ${TOP_INCDIR}/afs/volint.h \
60         ${TOP_LIBDIR}/libvolser.a
61
62 restorevol: restorevol.c
63         ${CC} ${CFLAGS} -o restorevol ${srcdir}/restorevol.c \
64                 ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ${XLIBS}
65
66 vos: vos.o ${VSOBJS} libvolser.a ${LIBS}
67         ${CC} ${LDFLAGS} -o vos vos.o $(VSOBJS) libvolser.a ${LIBS} ${XLIBS}
68
69 volserver: $(SOBJS) $(LIBS) ${TOP_LIBDIR}/libdir.a
70         ${CC} ${DBUG} -o volserver $(SOBJS) ${TOP_LIBDIR}/libdir.a \
71                 ${LDFLAGS} $(LIBS) ${XLIBS}
72
73 voldump: vol-dump.o ${VOLDUMP_LIBS}
74         ${CC} ${CFLAGS} -o voldump vol-dump.o ${VOLDUMP_LIBS} ${XLIBS}
75
76 libvolser.a: volint.cs.o  $(VSOBJS) volint.ss.o AFS_component_version_number.o
77         -$(RM) -f $@
78         $(AR) crv $@ volint.cs.o $(VSOBJS) volint.ss.o AFS_component_version_number.o 
79         $(RANLIB) $@
80
81 volser.h volerr.c: volerr.et volser.p.h
82         $(RM) -f volser.h volerr.c
83         ${COMPILE_ET} -p ${srcdir} volerr -h volser
84
85 volint.cs.c: volint.xg
86         ${RXGEN} -x -C -o $@ ${srcdir}/volint.xg
87
88 volint.ss.c: volint.xg
89         ${RXGEN} -x -S -o $@ ${srcdir}/volint.xg
90
91 volint.xdr.c: volint.xg
92         ${RXGEN} -x -c -o $@ ${srcdir}/volint.xg
93
94 volint.h: volint.xg
95         ${RXGEN} -x -h -o $@ ${srcdir}/volint.xg
96
97 volint.cs.c: volint.h
98 volint.ss.c: volint.h
99 volint.xdr.c: volint.h
100
101 #
102 # Dependencies
103 #
104 volint.cs.o: volint.cs.c ${INTINCLS}
105 volint.ss.o: volint.ss.c ${INTINCLS}
106 volint.xdr.o: volint.xdr.c ${INTINCLS}
107 vsutils.o: vsutils.c ${VINCLS} ${RINCLS} ${INTINCLS}
108 volmain.o: volmain.c ${VINCLS} ${RINCLS} AFS_component_version_number.c
109 volprocs.o: volprocs.c ${VINCLS} ${RINCLS} ${INTINCLS}
110 dumpstuff.o: dumpstuff.c ${VINCLS} ${RINCLS} ${INTINCLS}
111 voldump.o: voldump.c ${VINCLS} ${RINCLS}
112 vos.o: vos.c ${VINCLS} ${RINCLS} ${INTINCLS} AFS_component_version_number.c
113 vsprocs.o: vsprocs.c ${VINCLS} ${RINCLS} ${INTINCLS}
114 physio.o: physio.c ${VINCLS}
115 common.o: common.c ${VINCLS}
116 lockprocs.o: lockprocs.c ${VINCLS} ${INTINCLS} ${RINCLS}
117
118 #
119 # Installation targets
120 #
121 install: \
122         ${DESTDIR}${sbindir}/restorevol \
123         ${DESTDIR}${sbindir}/voldump \
124         ${DESTDIR}${includedir}/afs/volser.h \
125         ${DESTDIR}${includedir}/afs/volint.h \
126         ${DESTDIR}${sbindir}/vos \
127         ${DESTDIR}${afssrvsbindir}/vos \
128         ${DESTDIR}${afssrvlibexecdir}/volserver \
129         ${DESTDIR}${libdir}/afs/libvolser.a
130
131
132 ${DEST}/include/afs/volser.h: volser.h
133         ${INSTALL} $? $@
134
135 ${DEST}/include/afs/volint.h: volint.h
136         ${INSTALL} $? $@
137
138 ${DEST}/etc/restorevol: restorevol
139         ${INSTALL} $? $@
140
141 ${DEST}/etc/voldump: voldump
142         ${INSTALL} $? $@
143
144 ${DEST}/etc/vos ${DEST}/root.server/usr/afs/bin/vos: vos
145         ${INSTALL} $? $@
146
147 ${DEST}/lib/afs/libvolser.a: libvolser.a
148         ${INSTALL} $? $@
149
150 ${DEST}/root.server/usr/afs/bin/volserver: volserver
151         @case ${SYS_NAME} in \
152         alpha_dux4*|*linux*|rs_aix*|sgi_6*|sun4x*|sunx86*) \
153         echo "Don't install volserver for ${SYS_NAME}" ;; \
154         *_darwin_[1-6][0-9]) \
155         echo ${INSTALL} -ns $? $@ ; \
156         ${INSTALL} -ns $? $@ ;; \
157         *_darwin_*) \
158         echo "Don't install volserver for ${SYS_NAME}" ;; \
159         *) \
160         echo ${INSTALL} -ns $? $@ ; \
161         ${INSTALL} -ns $? $@ ;; \
162         esac
163
164 #
165 # Misc targets
166
167 clean:
168         $(RM) -f *.o *.a core volserver volint.ss.c volint.cs.c volint.h \
169         volint.xdr.c vos volser.h volerr.c AFS_component_version_number.c restorevol voldump
170
171 include ../config/Makefile.version
172
173 ${DESTDIR}${sbindir}/restorevol: restorevol
174         ${INSTALL} $? $@
175
176 ${DESTDIR}${sbindir}/voldump: voldump
177         ${INSTALL} $? $@
178
179 ${DESTDIR}${includedir}/afs/volser.h: volser.h
180         ${INSTALL} $? $@
181
182 ${TOP_INCDIR}/afs/volser.h: volser.h
183         ${INSTALL} $? $@
184
185 ${DESTDIR}${includedir}/afs/volint.h: volint.h
186         ${INSTALL} $? $@
187
188 ${TOP_INCDIR}/afs/volint.h: volint.h
189         ${INSTALL} $? $@
190
191 ${DESTDIR}${sbindir}/vos: vos
192         ${INSTALL} $? $@
193
194 ${DESTDIR}${afssrvsbindir}/vos: vos
195         ${INSTALL} $? $@
196
197 ${DESTDIR}${afssrvlibexecdir}/volserver: volserver
198         @case ${SYS_NAME} in \
199         alpha_dux4*|*linux*|rs_aix*|sgi_6*|sun4x*|sunx86*) \
200         echo "Don't install volserver for ${SYS_NAME}" ;; \
201         *_darwin_[1-6][0-9]) \
202         echo ${INSTALL} -ns $? $@ ; \
203         ${INSTALL} -ns $? $@ ;; \
204         *_darwin_*) \
205         echo "Don't install volserver for ${SYS_NAME}" ;; \
206         *) \
207         echo ${INSTALL} -ns $? $@ ; \
208         ${INSTALL} -ns $? $@ ;; \
209         esac
210
211 ${DESTDIR}${libdir}/afs/libvolser.a: libvolser.a
212         ${INSTALL} $? $@
213
214 ${TOP_LIBDIR}/libvolser.a: libvolser.a
215         ${INSTALL} $? $@
216
217 dest: \
218         ${DEST}/etc/restorevol \
219         ${DEST}/etc/voldump \
220         ${DEST}/include/afs/volser.h \
221         ${DEST}/include/afs/volint.h \
222         ${DEST}/etc/vos \
223         ${DEST}/root.server/usr/afs/bin/vos \
224         ${DEST}/root.server/usr/afs/bin/volserver \
225         ${DEST}/lib/afs/libvolser.a
226
227
228 check-splint::
229         sh $(HELPER_SPLINT) $(CFLAGS) \
230             vos.c restorevol.c \
231             vsprocs.c vsutils.c lockprocs.c volerr.c \
232             volmain.c volprocs.c physio.c common.c voltrans.c \
233             dumpstuff.c