9a2293891a49db52cc8b34ad74cd3731797d5d99
[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 srcdir=@srcdir@
9 include @TOP_OBJDIR@/src/config/Makefile.config
10 include @TOP_OBJDIR@/src/config/Makefile.lwp
11
12 INSTALL = @INSTALL@
13 INSTALL_DATA = @INSTALL_DATA@
14 INSTALL_PROGRAM = @INSTALL_PROGRAM@
15 INSTALL_SCRIPT = @INSTALL_SCRIPT@
16
17 LIBOBJS=cmd_errors.o cmd.o 
18 LIB64OBJS=cmd_errors64.o cmd64.o 
19
20 all: ${TOP_LIBDIR}/libcmd.a ${TOP_INCDIR}/afs/cmd.h
21
22 all64: all ${TOP_LIBDIR}/libcmd64.a
23
24 generated: cmd.h cmd_errors.c
25
26 ${TOP_LIBDIR}/libcmd.a: libcmd.a
27         ${INSTALL_DATA} $? $@
28
29 ${TOP_LIBDIR}/libcmd64.a: libcmd64.a
30         ${INSTALL_DATA} $? $@
31
32 ${TOP_INCDIR}/afs/cmd.h: cmd.h
33         ${INSTALL_DATA} $? $@
34
35 cmd.h: cmd_errors.et cmd.p.h
36         $(RM) -f cmd.h cmd_errors.c
37         ${COMPILE_ET} -p ${srcdir} cmd_errors -h cmd
38
39 cmd_errors.c: cmd.h 
40
41 cmd_errors.o: cmd_errors.c
42
43 cmd.o: cmd.c cmd.h
44
45 cmd_errors64.o: cmd_errors.c
46         ${CC} $(COMMON_CFLAGS) $(CPPFLAGS) ${XCFLAGS64} \
47                 -c -o cmd_errors64.o cmd_errors.c
48
49 cmd64.o: cmd.c cmd.h
50         ${CC} $(COMMON_CFLAGS) $(CPPFLAGS) ${XCFLAGS64} \
51                 -c -o cmd64.o ${srcdir}/cmd.c
52
53 libcmd64.a: ${LIB64OBJS} AFS_component_version_number64.o
54         -$(RM) -f $@
55         $(AR) crv $@ ${LIB64OBJS} AFS_component_version_number64.o
56         $(RANLIB) $@
57
58 libcmd.a: ${LIBOBJS} AFS_component_version_number.o
59         -$(RM) -f $@
60         $(AR) crv $@ ${LIBOBJS} AFS_component_version_number.o
61         $(RANLIB) $@
62
63 AFS_component_version_number64.o: AFS_component_version_number.c
64         ${CC} $(COMMON_CFLAGS) $(CPPFLAGS) ${XCFLAGS64} \
65                 -c -o AFS_component_version_number64.o \
66                 AFS_component_version_number.c
67
68 #
69 # Install targets
70 #
71 install: libcmd.a cmd.h
72         ${INSTALL} -d ${DESTDIR}${libdir}/afs
73         ${INSTALL} -d ${DESTDIR}${includedir}/afs
74         ${INSTALL_DATA} libcmd.a ${DESTDIR}${libdir}/afs/libcmd.a
75         ${INSTALL_DATA} cmd.h ${DESTDIR}${includedir}/afs/cmd.h
76
77 install64: install libcmd64.a
78         ${INSTALL_DATA} libcmd64.a ${DESTDIR}${libdir}/afs/libcmd64.a
79
80 dest: libcmd.a cmd.h
81         ${INSTALL} -d ${DEST}/lib/afs
82         ${INSTALL} -d ${DEST}/include/afs
83         ${INSTALL_DATA} libcmd.a ${DEST}/lib/afs/libcmd.a
84         ${INSTALL_DATA} cmd.h ${DEST}/include/afs/cmd.h
85
86 dest64: dest libcmd64.a
87         ${INSTALL_DATA} libcmd64.a ${DEST}/lib/afs/libcmd64.a
88
89 #
90 # Misc targets
91 #
92 test tests: 
93         (cd test; $(MAKE) )
94
95 clean:
96         $(RM) -f  *.a *.o ctest dtest cmd.h cmd_errors.c core AFS_component_version_number.c
97
98 include ../config/Makefile.version