LINUX: defer afs_remunlink when current->fs==NULL
[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 include @TOP_OBJDIR@/src/config/Makefile.libtool
13 include @TOP_OBJDIR@/src/config/Makefile.pthread
14
15 LT_current = 2
16 LT_revision = 0
17 LT_age = 0
18
19 LT_objs = glue.lo pioctl.lo setpag.lo kopenafs.lo \
20         AFS_component_version_number.lo
21
22 MODULE_INCLUDE  = -I. -I${srcdir} -I../sys
23
24 SFLAGS          = -I${TOP_INCDIR}
25 SYS             = ${srcdir}/../sys
26
27 @SHARED_ONLY@SHARED_LIBS = libkopenafs.la
28 @SHARED_ONLY@SHARED_SHLIBS_TOP = ${TOP_LIBDIR}/libkopenafs.${SHLIB_SUFFIX}
29
30 all: $(SHARED_SHLIBS_TOP) ${TOP_LIBDIR}/libkopenafs.a \
31                 ${TOP_INCDIR}/kopenafs.h
32
33 ${TOP_LIBDIR}/libkopenafs.${SHLIB_SUFFIX}: libkopenafs.la
34         ${LT_INSTALL_DATA} libkopenafs.la ${TOP_LIBDIR}/libkopenafs.la
35         ${RM} ${TOP_LIBDIR}/libkopenafs.la
36
37 ${TOP_LIBDIR}/libkopenafs.a: libkopenafs.a
38         ${INSTALL_DATA} libkopenafs.a $@
39
40 ${TOP_INCDIR}/kopenafs.h: kopenafs.h
41         ${INSTALL_DATA} $? $@
42
43 # Build rules for foreign sources.  The implicit ones don't work when our
44 # sources are in a different castle.
45 glue.lo: $(SYS)/glue.c $(SYS)/afssyscalls.h
46         $(LT_CCRULE) $(SYS)/glue.c
47
48 pioctl.lo: $(SYS)/pioctl.c $(SYS)/afssyscalls.h
49         $(LT_CCRULE) $(SYS)/pioctl.c
50
51 setpag.lo: $(SYS)/setpag.c $(SYS)/afssyscalls.h
52         $(LT_CCRULE) $(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
57 syscall.lo: $(SYS)/syscall.s
58         @set -e; set -x; case "$(SYS_NAME)" in \
59         sgi_*) \
60                 ${CC} ${AFS_CFLAGS} -c ${SYS}/syscall.s; \
61                 ;; \
62         rs_aix* | hp_ux10*) \
63                 $(PATH_CPP) -P ${SFLAGS} ${SYS}/syscall.s > syscall.ss; \
64                 as -o syscall.o syscall.ss; \
65                 $(RM) syscall.ss; \
66                 ;; \
67         *) \
68                 touch syscall.c ; \
69                 $(CC) $(AFS_CFLAGS) -c syscall.c -o syscall.o; \
70                 ;; \
71         esac
72         rm -f $@
73         echo "# Generated by libtool (GNU libtool) 0.0.0" > $@
74         echo "pic_object='syscall.o'" >> $@
75         echo "non_pic_object='syscall.o'" >> $@
76
77 libkopenafs.a: $(LT_objs)
78         $(LT_LDLIB_static) $(LT_objs)
79
80 libkopenafs.la: libkopenafs.la.sym $(LT_objs) libkopenafs.a
81         $(LT_LDLIB_shlib_only) $(LT_objs)
82
83 test-unlog: test-unlog.lo libkopenafs.a
84         $(LT_LDRULE_static) test-unlog.lo libkopenafs.a $(XLIBS)
85
86 test-setpag: test-setpag.lo libkopenafs.a
87         $(LT_LDRULE_static) test-setpag.lo libkopenafs.a $(XLIBS)
88
89 #
90 # Installation targets
91 #
92 install: $(SHARED_LIBS) libkopenafs.a
93         ${INSTALL} -d ${DESTDIR}${libdir}
94         ${INSTALL} -d ${DESTDIR}${includedir}
95         @SHARED_ONLY@${LT_INSTALL_DATA} libkopenafs.la ${DESTDIR}${libdir}/libkopenafs.la
96         @SHARED_ONLY@${RM} ${DESTDIR}${libdir}/libkopenafs.la
97         ${INSTALL_DATA} libkopenafs.a ${DESTDIR}${libdir}/libkopenafs.a
98         ${INSTALL_DATA} ${srcdir}/kopenafs.h ${DESTDIR}${includedir}/kopenafs.h
99
100 dest: $(SHARED_LIBS) libkopenafs.a
101         ${INSTALL} -d ${DEST}/lib
102         ${INSTALL} -d ${DEST}/include
103         @SHARED_ONLY@${LT_INSTALL_DATA} libkopenafs.la ${DEST}/lib/libkopenafs.la
104         @SHARED_ONLY@${RM} ${DEST}/lib/libkopenafs.la
105         ${INSTALL_DATA} libkopenafs.a ${DEST}/lib/libkopenafs.a
106         ${INSTALL_DATA} ${srcdir}/kopenafs.h ${DEST}/include/kopenafs.h
107
108 #
109 # Misc targets
110 #
111 clean:
112         ${LT_CLEAN}
113         $(RM) -f *.o *.a AFS_component_version_number.c \
114                 test-setpag test-unlog
115
116 include ../config/Makefile.version