Build system: Move install definitions to include
[openafs.git] / src / butc / 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 # Portions Copyright (c) 2003 Apple Computer, Inc.
9
10 srcdir=@srcdir@
11 include @TOP_OBJDIR@/src/config/Makefile.config
12 include @TOP_OBJDIR@/src/config/Makefile.lwp
13
14
15 INCLS=${TOP_INCDIR}/afs/partition.h ${TOP_INCDIR}/afs/volume.h \
16         ${TOP_INCDIR}/afs/vlserver.h ${TOP_INCDIR}/rx/rx.h \
17         ${TOP_INCDIR}/rx/xdr.h ${TOP_INCDIR}/afs/keys.h \
18         ${TOP_INCDIR}/afs/cellconfig.h ${TOP_INCDIR}/ubik.h \
19         ${TOP_INCDIR}/afs/cmd.h ${TOP_INCDIR}/afs/butc.h \
20         ${TOP_INCDIR}/afs/tcdata.h ${TOP_INCDIR}/afs/bubasics.h \
21         ${TOP_INCDIR}/afs/butm.h
22
23 HACKS=${TOP_LIBDIR}/libdir.a
24
25 LIBS=${TOP_LIBDIR}/libbudb.a \
26         $(TOP_LIBDIR)/libbxdb.a \
27         ${TOP_LIBDIR}/libbubasics.a \
28         ${TOP_LIBDIR}/libbutm.a \
29         ${TOP_LIBDIR}/libvolser.a \
30         ${TOP_LIBDIR}/libvldb.a \
31         ${TOP_LIBDIR}/vlib.a \
32         ${TOP_LIBDIR}/libacl.a \
33         ${TOP_LIBDIR}/libprot.a      \
34         ${TOP_LIBDIR}/libkauth.a \
35         ${TOP_LIBDIR}/libubik.a \
36         ${TOP_LIBDIR}/libauth.a \
37         ${TOP_LIBDIR}/librxkad.a \
38         ${TOP_LIBDIR}/libsys.a  \
39         ${TOP_LIBDIR}/librx.a \
40         ${TOP_LIBDIR}/libsys.a  \
41         ${TOP_LIBDIR}/liblwp.a \
42         ${TOP_LIBDIR}/libcmd.a \
43         ${TOP_LIBDIR}/libafscom_err.a \
44         ${TOP_LIBDIR}/libafshcrypto_lwp.a \
45         ${TOP_LIBDIR}/libusd.a \
46         ${TOP_LIBDIR}/util.a \
47         ${TOP_LIBDIR}/libprocmgmt.a
48
49 TESTOBJS=test.o
50
51 SOBJS=dbentries.o tcprocs.o lwps.o tcmain.o list.o recoverDb.o tcudbprocs.o \
52         dump.o tcstatus.o
53
54 all: butc read_tape
55
56 butc_test: ${TESTOBJS} ${LIBS} ${INCLS} ${HACKS}
57         $(AFS_LDRULE) ${TESTOBJS} ${LIBS} $(LIB_roken) ${XLIBS}
58
59 tdump: tdump.c AFS_component_version_number.c
60         $(CC) $(AFS_CPPFLAGS) $(AFS_CFLAGS) $(AFS_LDFLAGS) \
61                 ${srcdir}/tdump.c -o tdump
62
63 butc: ${SOBJS} ${LIBS} ${INCLS} ${HACKS}
64         @case ${SYS_NAME} in \
65           rs_aix*) $(AFS_LDRULE) ${SOBJS} ${LIBS} $(LIB_roken) ${XLIBS} \
66                 /usr/lib/libc_r.a ;; \
67           *)       $(AFS_LDRULE) ${SOBJS} ${LIBS} $(LIB_roken) ${XLIBS} ;; \
68         esac
69
70 tcmain.o: tcmain.c ${INCLS} AFS_component_version_number.c
71 dbentries.o: dbentries.c ${INCLS}
72 tcprocs.o: tcprocs.c ${INCLS}
73 test.o: test.c ${INCLS} AFS_component_version_number.c
74 lwps.o: lwps.c ${INCLS}
75 list.o: list.c ${INCLS}
76 recoverDb.o: recoverDb.c ${INCLS}
77 tcudbprocs.o: tcudbprocs.c ${INCLS}
78 dump.o: dump.c ${INCLS}
79 tcstatus.o: tcstatus.c ${INCLS}
80
81 read_tape: read_tape.c
82         $(CC) $(AFS_CPPFLAGS) $(AFS_CFLAGS) $(AFS_LDFLAGS) \
83                 -o read_tape ${srcdir}/read_tape.c \
84                 ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/libusd.a \
85                 ${TOP_LIBDIR}/util.a $(LIB_roken)
86
87 # Errors
88 CFLAGS_tcudbprocs.o=@CFLAGS_NOERROR@
89
90 clean:
91         $(RM) -f butc *.o butc_test core tdump read_tape AFS_component_version_number.c
92
93 install: butc read_tape
94         ${INSTALL} -d ${DESTDIR}${sbindir}
95         @case ${SYS_NAME} in \
96         alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux*) \
97                 echo "Don't install butc for ${SYS_NAME} (will install from tbutc)" ;; \
98         *_darwin_[1-6][0-9]) \
99                 echo ${INSTALL_PROGRAM} butc ${DESTDIR}${sbindir}/butc ; \
100                 ${INSTALL_PROGRAM} butc ${DESTDIR}${sbindir}/butc ;; \
101         *_darwin_*) \
102                 echo "Don't install butc for ${SYS_NAME} (will install from tbutc)" ;; \
103         *) \
104                 echo ${INSTALL_PROGRAM} butc ${DESTDIR}${sbindir}/butc ; \
105                 ${INSTALL_PROGRAM} butc ${DESTDIR}${sbindir}/butc ;; \
106         esac
107         ${INSTALL_PROGRAM} read_tape ${DESTDIR}${sbindir}/read_tape
108
109 dest: butc read_tape
110         ${INSTALL} -d ${DEST}/etc
111         @case ${SYS_NAME} in \
112         alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux*) \
113                 echo "Don't install butc for ${SYS_NAME} (will install from tbutc)" ;; \
114         *_darwin_[1-6][0-9]) \
115                 echo ${INSTALL_PROGRAM} butc ${DEST}/etc/butc ; \
116                 ${INSTALL_PROGRAM} butc ${DEST}/etc/butc ;; \
117         *_darwin_*) \
118                 echo "Don't install butc for ${SYS_NAME} (will install from tbutc)" ;; \
119         *) \
120                 echo ${INSTALL_PROGRAM} butc ${DEST}/etc/butc ; \
121                 ${INSTALL_PROGRAM} butc ${DEST}/etc/butc ;; \
122         esac
123         ${INSTALL_PROGRAM} read_tape ${DEST}/etc/read_tape
124
125 include ../config/Makefile.version