initial-objdir-support-20011017
[openafs.git] / src / cmd / 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 TOP_OBJDIR=@TOP_OBJDIR@
12 srcdir=@srcdir@
13 VPATH=${srcdir}
14 prefix=@prefix@
15 exec_prefix=@exec_prefix@
16 bindir=@bindir@
17 sbindir=@sbindir@
18 libexecdir=@libexecdir@
19 libdir=@libdir@
20 includedir=@includedir@
21 mandir=@mandir@
22 afssrvbindir=@afssrvbindir@
23 afssrvsbindir=@afssrvsbindir@
24 afssrvlibexecdir=@afssrvlibexecdir@
25 RXGEN=${TOP_OBJDIR}/src/rxgen/rxgen
26 TOP_SRCDIR=@TOP_SRCDIR@
27 SYS_NAME=@AFS_SYSNAME@
28
29 SHELL = /bin/sh
30
31 include ../config/Makefile.${SYS_NAME}
32
33 COMPILE_ET=${TOP_OBJDIR}/src/comerr/compile_et
34
35 LIBOBJS=cmd_errors.o cmd.o 
36 LIB64OBJS=cmd_errors64.o cmd64.o 
37
38 CFLAGS=${OPTMZ} -I. -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} ${XCFLAGS}
39
40 all: ${TOP_LIBDIR}/libcmd.a ${TOP_INCDIR}/afs/cmd.h
41
42 all64: all ${TOP_LIBDIR}/libcmd64.a
43
44 cmd.h cmd_errors.c: cmd_errors.et cmd.p.h
45         $(RM) -f cmd.h cmd_errors.c
46         ${COMPILE_ET} -p ${srcdir} cmd_errors -h cmd
47
48 cmd_errors.o: cmd_errors.c
49
50 cmd.o: cmd.c cmd.h
51
52 cmd_errors64.o: cmd_errors.c
53         ${CC} ${OPTMZ} -I. -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} ${XCFLAGS64} -c -o cmd_errors64.o ${srcdir}/cmd_errors.c
54
55 cmd64.o: cmd.c cmd.h
56         ${CC} ${OPTMZ} -I. -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} ${XCFLAGS64} -c -o cmd64.o ${srcdir}/cmd.c
57
58
59 libcmd64.a: ${LIB64OBJS} AFS_component_version_number64.o
60         -$(RM) -f $@
61         $(AR) crv $@ ${LIB64OBJS} AFS_component_version_number64.o
62         $(RANLIB) $@
63
64 libcmd.a: ${LIBOBJS} AFS_component_version_number.o
65         -$(RM) -f $@
66         $(AR) crv $@ ${LIBOBJS} AFS_component_version_number.o
67         $(RANLIB) $@
68
69 AFS_component_version_number64.o: AFS_component_version_number.c
70         ${CC} ${OPTMZ} -I${TOP_INCDIR} ${XCFLAGS64} -c -o AFS_component_version_number64.o AFS_component_version_number.c
71
72 #
73 # Install targets
74 #
75 install: ${DESTDIR}${libdir}/afs/libcmd.a ${DESTDIR}${includedir}/afs/cmd.h
76
77 install64: install ${DESTDIR}${libdir}/afs/libcmd64.a
78
79 ${DEST}/include/afs/cmd.h: cmd.h
80         ${INSTALL} $? $@
81
82 ${DEST}/lib/afs/libcmd.a: libcmd.a
83         ${INSTALL} $? $@
84
85 ${DEST}/lib/afs/libcmd64.a: libcmd64.a
86         ${INSTALL} $? $@
87
88 #
89 # Misc targets
90 #
91 test tests: 
92         (cd test; $(MAKE) )
93
94 clean:
95         $(RM) -f  *.a *.o ctest dtest cmd.h cmd_errors.c core AFS_component_version_number.c
96
97 include ../config/Makefile.version
98 ${DESTDIR}${libdir}/afs/libcmd.a: libcmd.a
99         ${INSTALL} $? $@
100
101 ${TOP_LIBDIR}/libcmd.a: libcmd.a
102         ${INSTALL} $? $@
103
104 ${DESTDIR}${libdir}/afs/libcmd64.a: libcmd64.a
105         ${INSTALL} $? $@
106
107 ${TOP_LIBDIR}/libcmd64.a: libcmd64.a
108         ${INSTALL} $? $@
109
110 ${DESTDIR}${includedir}/afs/cmd.h: cmd.h
111         ${INSTALL} $? $@
112
113 ${TOP_INCDIR}/afs/cmd.h: cmd.h
114         ${INSTALL} $? $@
115
116 dest: ${DEST}/lib/afs/libcmd.a ${DEST}/include/afs/cmd.h
117
118 dest64: dest ${DEST}/lib/afs/libcmd64.a