1 # Copyright 2000, International Business Machines Corporation and others.
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
8 # Portions Copyright (c) 2003 Apple Computer, Inc.
11 include @TOP_OBJDIR@/src/config/Makefile.config
13 INSTALL_DATA = @INSTALL_DATA@
14 INSTALL_PROGRAM = @INSTALL_PROGRAM@
15 INSTALL_SCRIPT = @INSTALL_SCRIPT@
17 # API version. When something changes, increment as appropriate.
18 # Ignore at your own risk.
23 INCLUDES = -I. -I${srcdir} -I../sys
24 CFLAGS = ${COMMON_CFLAGS} ${INCLUDES} ${MT_CFLAGS} ${SHLIB_CFLAGS}
26 SYS = ${srcdir}/../sys
27 SYSOBJS = glue.o pioctl.o setpag.o
28 LIBOBJS = kopenafs.o ${SYSOBJS} AFS_component_version_number.o
30 LIBKOPENAFS = libkopenafs.${SHLIB_SUFFIX}.${MAJOR}.${MINOR}
32 all: ${TOP_LIBDIR}/${LIBKOPENAFS} ${TOP_LIBDIR}/libkopenafs.a \
33 ${TOP_INCDIR}/kopenafs.h
35 ${TOP_LIBDIR}/${LIBKOPENAFS}: ${LIBKOPENAFS}
36 ../config/shlib-install -d ${TOP_LIBDIR} \
37 -l libkopenafs -M ${MAJOR} -m ${MINOR}
39 ${TOP_LIBDIR}/libkopenafs.a: libkopenafs.a
40 ${INSTALL_DATA} libkopenafs.a $@
42 ${TOP_INCDIR}/kopenafs.h: kopenafs.h
43 ${INSTALL_DATA} kopenafs.h $@
45 glue.o: ${SYS}/glue.c ${SYS}/afssyscalls.h
46 ${CCOBJ} ${CFLAGS} -c ${SYS}/glue.c
48 pioctl.o: ${SYS}/pioctl.c ${SYS}/afssyscalls.h
49 ${CCOBJ} ${CFLAGS} -c ${SYS}/pioctl.c
51 setpag.o: ${SYS}/setpag.c ${SYS}/afssyscalls.h
52 ${CCOBJ} ${CFLAGS} -c ${SYS}/setpag.c
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 \
59 ${CC} ${CFLAGS} -c ${SYS}/syscall.s; \
62 /lib/cpp -P ${SFLAGS} ${srcdir}/syscall.s syscall.ss; \
63 as -o syscall.o syscall.ss; \
71 libkopenafs.a: ${LIBOBJS}
73 @set -e; set -x; case "$(SYS_NAME)" in \
74 sgi_* | rs_aix* | hp_ux10*) \
75 ${AR} crv $@ ${LIBOBJS} syscall.o ;; \
77 ${AR} crv $@ ${LIBOBJS} ;; \
81 ${LIBKOPENAFS}: ${LIBOBJS}
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} ; \
89 ../config/shlib-build -d $(srcdir) -l libkopenafs \
90 -M ${MAJOR} -m ${MINOR} -- \
91 ${LIBOBJS} ${MT_LIBS} ; \
95 test-unlog: test-unlog.o libkopenafs.a
96 ${CC} -o test-unlog test-unlog.o libkopenafs.a ${XLIBS} ${CFLAGS}
98 test-setpag: test-setpag.o libkopenafs.a
99 ${CC} -o test-setpag test-setpag.o libkopenafs.a ${XLIBS} ${CFLAGS}
102 # Installation targets
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}
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}
124 $(RM) -f *.o *.a ${LIBKOPENAFS} AFS_component_version_number.c \
125 test-setpag test-unlog
127 include ../config/Makefile.version