ef44d5b7c0a8418be9c02ac15505db99d379adf1
[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
13 LIBOBJS=cmd_errors.o cmd.o config_file.o
14 LIBPICOBJS=cmd_errors_pic.o cmd_pic.o
15 LIB64OBJS=cmd_errors64.o cmd64.o 
16
17 all: ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/libcmd_pic.a ${TOP_INCDIR}/afs/cmd.h
18
19 all64: all ${TOP_LIBDIR}/libcmd64.a
20
21 generated: cmd.h cmd_errors.c
22
23 ${TOP_LIBDIR}/libcmd.a: libcmd.a
24         ${INSTALL_DATA} $? $@
25
26 ${TOP_LIBDIR}/libcmd_pic.a: libcmd_pic.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 config_file.o: $(TOP_SRCDIR)/external/heimdal/krb5/config_file.c krb5_locl.h
46         $(AFS_CCRULE) -c $(TOP_SRCDIR)/external/heimdal/krb5/config_file.c
47
48 cmd_errors64.o: cmd_errors.c
49         ${CC} $(COMMON_CFLAGS) $(CPPFLAGS) ${XCFLAGS64} \
50                 -c -o cmd_errors64.o cmd_errors.c
51
52 cmd64.o: cmd.c cmd.h
53         ${CC} $(COMMON_CFLAGS) $(CPPFLAGS) ${XCFLAGS64} \
54                 -c -o cmd64.o ${srcdir}/cmd.c
55
56 cmd_errors_pic.o: cmd_errors.c
57         $(SHD_CCRULE) cmd_errors.c
58
59 cmd_pic.o: cmd.c cmd.h
60         $(SHD_CCRULE) ${srcdir}/cmd.c
61
62 libcmd64.a: ${LIB64OBJS} AFS_component_version_number64.o
63         -$(RM) -f $@
64         $(AR) crv $@ ${LIB64OBJS} AFS_component_version_number64.o
65         $(RANLIB) $@
66
67 libcmd.a: ${LIBOBJS} AFS_component_version_number.o
68         -$(RM) -f $@
69         $(AR) crv $@ ${LIBOBJS} AFS_component_version_number.o
70         $(RANLIB) $@
71
72 libcmd_pic.a: ${LIBPICOBJS} AFS_component_version_number_pic.o
73         -$(RM) -f $@
74         $(AR) crv $@ ${LIBPICOBJS} AFS_component_version_number_pic.o
75         $(RANLIB) $@
76
77 AFS_component_version_number64.o: AFS_component_version_number.c
78         ${CC} $(COMMON_CFLAGS) $(CPPFLAGS) ${XCFLAGS64} \
79                 -c -o AFS_component_version_number64.o \
80                 AFS_component_version_number.c
81
82 AFS_component_version_number_pic.o: AFS_component_version_number.c
83         $(SHD_CCRULE) AFS_component_version_number.c
84
85 #
86 # Install targets
87 #
88 install: libcmd.a libcmd_pic.a cmd.h
89         ${INSTALL} -d ${DESTDIR}${libdir}/afs
90         ${INSTALL} -d ${DESTDIR}${includedir}/afs
91         ${INSTALL_DATA} libcmd.a ${DESTDIR}${libdir}/afs/libcmd.a
92         ${INSTALL_DATA} libcmd_pic.a ${DESTDIR}${libdir}/afs/libcmd_pic.a
93         ${INSTALL_DATA} cmd.h ${DESTDIR}${includedir}/afs/cmd.h
94
95 install64: install libcmd64.a
96         ${INSTALL_DATA} libcmd64.a ${DESTDIR}${libdir}/afs/libcmd64.a
97
98 dest: libcmd.a cmd.h libcmd_pic.a
99         ${INSTALL} -d ${DEST}/lib/afs
100         ${INSTALL} -d ${DEST}/include/afs
101         ${INSTALL_DATA} libcmd.a ${DEST}/lib/afs/libcmd.a
102         ${INSTALL_DATA} cmd.h ${DEST}/include/afs/cmd.h
103         ${INSTALL_DATA} libcmd_pic.a ${DEST}/lib/afs/libcmd_pic.a
104
105 dest64: dest libcmd64.a
106         ${INSTALL_DATA} libcmd64.a ${DEST}/lib/afs/libcmd64.a
107
108 #
109 # Misc targets
110 #
111 test tests: 
112         (cd test; $(MAKE) )
113
114 clean:
115         $(RM) -f  *.a *.o ctest dtest cmd.h cmd_errors.c core AFS_component_version_number.c
116
117 include ../config/Makefile.version