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