cmd: Use strl* rather than strn* to avoid overrun
[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 
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 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 cmd_errors_pic.o: cmd_errors.c
54         $(SHD_CCRULE) cmd_errors.c
55
56 cmd_pic.o: cmd.c cmd.h
57         $(SHD_CCRULE) ${srcdir}/cmd.c
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 libcmd_pic.a: ${LIBPICOBJS} AFS_component_version_number_pic.o
70         -$(RM) -f $@
71         $(AR) crv $@ ${LIBPICOBJS} AFS_component_version_number_pic.o
72         $(RANLIB) $@
73
74 AFS_component_version_number64.o: AFS_component_version_number.c
75         ${CC} $(COMMON_CFLAGS) $(CPPFLAGS) ${XCFLAGS64} \
76                 -c -o AFS_component_version_number64.o \
77                 AFS_component_version_number.c
78
79 AFS_component_version_number_pic.o: AFS_component_version_number.c
80         $(SHD_CCRULE) AFS_component_version_number.c
81
82 #
83 # Install targets
84 #
85 install: libcmd.a libcmd_pic.a cmd.h
86         ${INSTALL} -d ${DESTDIR}${libdir}/afs
87         ${INSTALL} -d ${DESTDIR}${includedir}/afs
88         ${INSTALL_DATA} libcmd.a ${DESTDIR}${libdir}/afs/libcmd.a
89         ${INSTALL_DATA} libcmd_pic.a ${DESTDIR}${libdir}/afs/libcmd_pic.a
90         ${INSTALL_DATA} cmd.h ${DESTDIR}${includedir}/afs/cmd.h
91
92 install64: install libcmd64.a
93         ${INSTALL_DATA} libcmd64.a ${DESTDIR}${libdir}/afs/libcmd64.a
94
95 dest: libcmd.a cmd.h libcmd_pic.a
96         ${INSTALL} -d ${DEST}/lib/afs
97         ${INSTALL} -d ${DEST}/include/afs
98         ${INSTALL_DATA} libcmd.a ${DEST}/lib/afs/libcmd.a
99         ${INSTALL_DATA} cmd.h ${DEST}/include/afs/cmd.h
100         ${INSTALL_DATA} libcmd_pic.a ${DEST}/lib/afs/libcmd_pic.a
101
102 dest64: dest libcmd64.a
103         ${INSTALL_DATA} libcmd64.a ${DEST}/lib/afs/libcmd64.a
104
105 #
106 # Misc targets
107 #
108 test tests: 
109         (cd test; $(MAKE) )
110
111 clean:
112         $(RM) -f  *.a *.o ctest dtest cmd.h cmd_errors.c core AFS_component_version_number.c
113
114 include ../config/Makefile.version