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 SFLAGS = -I${TOP_INCDIR}
27 SYS = ${srcdir}/../sys
28 SYSOBJS = glue.o pioctl.o setpag.o
29 LIBOBJS = kopenafs.o ${SYSOBJS} AFS_component_version_number.o
31 LIBKOPENAFS = libkopenafs.${SHLIB_SUFFIX}.${MAJOR}.${MINOR}
33 all: ${TOP_LIBDIR}/${LIBKOPENAFS} ${TOP_LIBDIR}/libkopenafs.a \
34 ${TOP_INCDIR}/kopenafs.h
36 ${TOP_LIBDIR}/${LIBKOPENAFS}: ${LIBKOPENAFS}
37 ../config/shlib-install -d ${TOP_LIBDIR} \
38 -l libkopenafs -M ${MAJOR} -m ${MINOR}
40 ${TOP_LIBDIR}/libkopenafs.a: libkopenafs.a
41 ${INSTALL_DATA} libkopenafs.a $@
43 ${TOP_INCDIR}/kopenafs.h: kopenafs.h
46 glue.o: ${SYS}/glue.c ${SYS}/afssyscalls.h
47 ${CCOBJ} ${CFLAGS} -c ${SYS}/glue.c
49 pioctl.o: ${SYS}/pioctl.c ${SYS}/afssyscalls.h
50 ${CCOBJ} ${CFLAGS} -c ${SYS}/pioctl.c
52 setpag.o: ${SYS}/setpag.c ${SYS}/afssyscalls.h
53 ${CCOBJ} ${CFLAGS} -c ${SYS}/setpag.c
55 # This file is only actually used on SGI and AIX, but some systems can't cope
56 # with an empty .o file being included in a link.
57 syscall.o: ${SYS}/syscall.s
58 @set -e; set -x; case "$(SYS_NAME)" in \
60 ${CC} ${CFLAGS} -c ${SYS}/syscall.s; \
63 $(PATH_CPP) -P ${SFLAGS} ${SYS}/syscall.s > syscall.ss; \
64 as -o syscall.o syscall.ss; \
72 libkopenafs.a: ${LIBOBJS} syscall.o
74 @set -e; set -x; case "$(SYS_NAME)" in \
75 sgi_* | rs_aix* | hp_ux10*) \
76 ${AR} crv $@ ${LIBOBJS} syscall.o ;; \
78 ${AR} crv $@ ${LIBOBJS} ;; \
82 ${LIBKOPENAFS}: ${LIBOBJS} syscall.o
83 @set -e; set -x; case ${SYS_NAME} in \
84 sgi_* | rs_aix* | hp_ux10*) \
85 ../config/shlib-build -d $(srcdir) -l libkopenafs \
86 -M ${MAJOR} -m ${MINOR} -- \
87 ${LIBOBJS} syscall.o ${MT_LIBS} ; \
90 ../config/shlib-build -d $(srcdir) -l libkopenafs \
91 -M ${MAJOR} -m ${MINOR} -- \
92 ${LIBOBJS} ${MT_LIBS} ; \
96 test-unlog: test-unlog.o libkopenafs.a
97 ${CC} -o test-unlog test-unlog.o libkopenafs.a ${XLIBS} ${CFLAGS}
99 test-setpag: test-setpag.o libkopenafs.a
100 ${CC} -o test-setpag test-setpag.o libkopenafs.a ${XLIBS} ${CFLAGS}
103 # Installation targets
105 install: ${LIBKOPENAFS}
106 ${INSTALL} -d ${DESTDIR}${libdir}
107 ${INSTALL} -d ${DESTDIR}${includedir}
108 ${INSTALL_DATA} libkopenafs.a ${DESTDIR}${libdir}/libkopenafs.a
109 ${INSTALL_DATA} kopenafs.h ${DESTDIR}${includedir}/kopenafs.h
110 ../config/shlib-install -d ${DESTDIR}${libdir} \
111 -l libkopenafs -M ${MAJOR} -m ${MINOR}
114 ${INSTALL} -d ${DEST}/lib
115 ${INSTALL} -d ${DEST}/include
116 ${INSTALL_DATA} libkopenafs.a ${DEST}/lib/libkopenafs.a
117 ${INSTALL_DATA} kopenafs.h ${DEST}/include/kopenafs.h
118 ../config/shlib-install -d ${DEST}/lib \
119 -l libkopenafs -M ${MAJOR} -m ${MINOR}
125 $(RM) -f *.o *.a ${LIBKOPENAFS} AFS_component_version_number.c \
126 test-setpag test-unlog
128 include ../config/Makefile.version