aix-kopenafs-cpp-20090605
[openafs.git] / src / kopenafs / 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 # Portions Copyright (c) 2003 Apple Computer, Inc.
9
10 srcdir=@srcdir@
11 include @TOP_OBJDIR@/src/config/Makefile.config
12 INSTALL = @INSTALL@
13 INSTALL_DATA = @INSTALL_DATA@
14 INSTALL_PROGRAM = @INSTALL_PROGRAM@
15 INSTALL_SCRIPT = @INSTALL_SCRIPT@
16
17 # API version. When something changes, increment as appropriate. 
18 # Ignore at your own risk.
19 MAJOR           = 1
20 MINOR           = 0
21
22 CC              = ${MT_CC}
23 INCLUDES        = -I. -I${srcdir} -I../sys
24 CFLAGS          = ${COMMON_CFLAGS} ${INCLUDES} ${MT_CFLAGS} ${SHLIB_CFLAGS}
25
26 SYS             = ${srcdir}/../sys
27 SYSOBJS         = glue.o pioctl.o setpag.o
28 LIBOBJS         = kopenafs.o ${SYSOBJS} AFS_component_version_number.o
29
30 LIBKOPENAFS     = libkopenafs.${SHLIB_SUFFIX}.${MAJOR}.${MINOR}
31
32 all: ${TOP_LIBDIR}/${LIBKOPENAFS} ${TOP_LIBDIR}/libkopenafs.a \
33                 ${TOP_INCDIR}/kopenafs.h
34
35 ${TOP_LIBDIR}/${LIBKOPENAFS}: ${LIBKOPENAFS}
36         ../config/shlib-install -d ${TOP_LIBDIR} \
37                 -l libkopenafs -M ${MAJOR} -m ${MINOR}
38
39 ${TOP_LIBDIR}/libkopenafs.a: libkopenafs.a
40         ${INSTALL_DATA} libkopenafs.a $@
41
42 ${TOP_INCDIR}/kopenafs.h: kopenafs.h
43         ${INSTALL_DATA} kopenafs.h $@
44
45 glue.o: ${SYS}/glue.c ${SYS}/afssyscalls.h
46         ${CCOBJ} ${CFLAGS} -c ${SYS}/glue.c
47
48 pioctl.o: ${SYS}/pioctl.c ${SYS}/afssyscalls.h
49         ${CCOBJ} ${CFLAGS} -c ${SYS}/pioctl.c
50
51 setpag.o: ${SYS}/setpag.c ${SYS}/afssyscalls.h
52         ${CCOBJ} ${CFLAGS} -c ${SYS}/setpag.c
53
54 # This file is only actually used on SGI and AIX, but some systems can't cope
55 # with an empty .o file being included in a link.
56 syscall.o: ${SYS}/syscall.s
57         @set -e; set -x; case "$(SYS_NAME)" in \
58         sgi_*) \
59                 ${CC} ${CFLAGS} -c ${SYS}/syscall.s; \
60                 ;; \
61         rs_aix* | hp_ux10*) \
62                 $(PATH_CPP) -P ${SFLAGS} ${srcdir}/syscall.s > syscall.ss; \
63                 as -o syscall.o syscall.ss; \
64                 $(RM) syscall.ss; \
65                 ;; \
66         *) \
67                 touch syscall.o ; \
68                 ;; \
69         esac
70
71 libkopenafs.a: ${LIBOBJS} syscall.o
72         ${RM} -f $@
73         @set -e; set -x; case "$(SYS_NAME)" in \
74         sgi_* | rs_aix* | hp_ux10*) \
75                 ${AR} crv $@ ${LIBOBJS} syscall.o ;; \
76         *) \
77                 ${AR} crv $@ ${LIBOBJS} ;; \
78         esac
79         ${RANLIB} $@
80
81 ${LIBKOPENAFS}: ${LIBOBJS} syscall.o
82         @set -e; set -x; case ${SYS_NAME} in \
83         sgi_* | rs_aix* | hp_ux10*) \
84                 ../config/shlib-build -d $(srcdir) -l libkopenafs \
85                         -M ${MAJOR} -m ${MINOR} -- \
86                         ${LIBOBJS} syscall.o ${MT_LIBS} ; \
87                 ;; \
88         *) \
89                 ../config/shlib-build -d $(srcdir) -l libkopenafs \
90                         -M ${MAJOR} -m ${MINOR} -- \
91                         ${LIBOBJS} ${MT_LIBS} ; \
92                 ;; \
93         esac
94
95 test-unlog: test-unlog.o libkopenafs.a
96         ${CC} -o test-unlog test-unlog.o libkopenafs.a ${XLIBS} ${CFLAGS}
97
98 test-setpag: test-setpag.o libkopenafs.a
99         ${CC} -o test-setpag test-setpag.o libkopenafs.a ${XLIBS} ${CFLAGS}
100
101 #
102 # Installation targets
103 #
104 install: ${LIBKOPENAFS}
105         ${INSTALL} -d ${DESTDIR}${libdir}
106         ${INSTALL} -d ${DESTDIR}${includedir}
107         ${INSTALL_DATA} libkopenafs.a ${DESTDIR}${libdir}/libkopenafs.a
108         ${INSTALL_DATA} kopenafs.h ${DESTDIR}${includedir}/kopenafs.h
109         ../config/shlib-install -d ${DESTDIR}${libdir} \
110                 -l libkopenafs -M ${MAJOR} -m ${MINOR}
111
112 dest: ${LIBKOPENAFS}
113         ${INSTALL} -d ${DEST}/lib
114         ${INSTALL} -d ${DEST}/include
115         ${INSTALL_DATA} libkopenafs.a ${DEST}/lib/libkopenafs.a
116         ${INSTALL_DATA} kopenafs.h ${DEST}/include/kopenafs.h
117         ../config/shlib-install -d ${DEST}/lib \
118                 -l libkopenafs -M ${MAJOR} -m ${MINOR}
119
120 #
121 # Misc targets
122 #
123 clean:
124         $(RM) -f *.o *.a ${LIBKOPENAFS} AFS_component_version_number.c \
125                 test-setpag test-unlog
126
127 include ../config/Makefile.version