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 # API version. When something changes, increment as appropriate.
14 # Ignore at your own risk.
19 INCLUDES = -I. -I${srcdir} -I../sys
20 CFLAGS = ${COMMON_CFLAGS} ${INCLUDES} ${MT_CFLAGS} ${SHLIB_CFLAGS}
22 SYS = ${srcdir}/../sys
23 SYSOBJS = glue.o pioctl.o setpag.o
24 LIBOBJS = kopenafs.o ${SYSOBJS} AFS_component_version_number.o
26 LIBKOPENAFS = libkopenafs.${SHLIB_SUFFIX}.${MAJOR}.${MINOR}
28 all: ${TOP_LIBDIR}/${LIBKOPENAFS} ${TOP_LIBDIR}/libkopenafs.a \
29 ${TOP_INCDIR}/kopenafs.h
31 ${TOP_LIBDIR}/${LIBKOPENAFS}: ${LIBKOPENAFS}
32 ../config/shlib-install -d ${TOP_LIBDIR} \
33 -l libkopenafs -M ${MAJOR} -m ${MINOR}
35 ${TOP_LIBDIR}/libkopenafs.a: libkopenafs.a
36 ${INSTALL_DATA} libkopenafs.a $@
38 ${TOP_INCDIR}/kopenafs.h: kopenafs.h
39 ${INSTALL_DATA} kopenafs.h $@
41 glue.o: ${SYS}/glue.c ${SYS}/afssyscalls.h
42 ${CCOBJ} ${CFLAGS} -c ${SYS}/glue.c
44 pioctl.o: ${SYS}/pioctl.c ${SYS}/afssyscalls.h
45 ${CCOBJ} ${CFLAGS} -c ${SYS}/pioctl.c
47 setpag.o: ${SYS}/setpag.c ${SYS}/afssyscalls.h
48 ${CCOBJ} ${CFLAGS} -c ${SYS}/setpag.c
50 # This file is only actually used on SGI and AIX, but some systems can't cope
51 # with an empty .o file being included in a link.
52 syscall.o: ${SYS}/syscall.s
53 @set -e; set -x; case "$(SYS_NAME)" in \
55 ${CC} ${CFLAGS} -c ${SYS}/syscall.s; \
58 /lib/cpp -P ${SFLAGS} ${srcdir}/syscall.s syscall.ss; \
59 as -o syscall.o syscall.ss; \
67 libkopenafs.a: ${LIBOBJS}
69 @set -e; set -x; case "$(SYS_NAME)" in \
70 sgi_* | rs_aix* | hp_ux10*) \
71 ${AR} crv $@ ${LIBOBJS} syscall.o ;; \
73 ${AR} crv $@ ${LIBOBJS} ;; \
77 ${LIBKOPENAFS}: ${LIBOBJS}
78 @set -e; set -x; case ${SYS_NAME} in \
79 sgi_* | rs_aix* | hp_ux10*) \
80 ../config/shlib-build -d $(srcdir) -l libkopenafs \
81 -M ${MAJOR} -m ${MINOR} -- \
82 ${LIBOBJS} syscall.o ${MT_LIBS} ; \
85 ../config/shlib-build -d $(srcdir) -l libkopenafs \
86 -M ${MAJOR} -m ${MINOR} -- \
87 ${LIBOBJS} ${MT_LIBS} ; \
91 test-unlog: test-unlog.o libkopenafs.a
92 ${CC} -o test-unlog test-unlog.o libkopenafs.a ${XLIBS} ${CFLAGS}
94 test-setpag: test-setpag.o libkopenafs.a
95 ${CC} -o test-setpag test-setpag.o libkopenafs.a ${XLIBS} ${CFLAGS}
98 # Installation targets
100 install: ${LIBKOPENAFS}
101 ${INSTALL} -d ${DESTDIR}${libdir}
102 ${INSTALL} -d ${DESTDIR}${includedir}
103 ${INSTALL_DATA} libkopenafs.a ${DESTDIR}${libdir}/libkopenafs.a
104 ${INSTALL_DATA} kopenafs.h ${DESTDIR}${includedir}/kopenafs.h
105 ../config/shlib-install -d ${DESTDIR}${libdir} \
106 -l libkopenafs -M ${MAJOR} -m ${MINOR}
109 ${INSTALL} -d ${DEST}/lib
110 ${INSTALL} -d ${DEST}/include
111 ${INSTALL_DATA} libkopenafs.a ${DEST}/lib/libkopenafs.a
112 ${INSTALL_DATA} kopenafs.h ${DEST}/include/kopenafs.h
113 ../config/shlib-install -d ${DEST}/lib \
114 -l libkopenafs -M ${MAJOR} -m ${MINOR}
120 $(RM) -f *.o *.a ${LIBKOPENAFS} AFS_component_version_number.c \
121 test-setpag test-unlog
123 include ../config/Makefile.version