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