4cdec2d0881317af33baa1cbc38ba5c7ba9d692f
[openafs.git] / src / libafs / MakefileProto.FBSD.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 srcdir=@srcdir@
9 include @TOP_OBJDIR@/src/config/Makefile.config
10
11 # tell bsd.kmod.mk to build us vnode_if*
12 SRCS=   vnode_if.h
13
14 # We must set SRCS to include at least one .c file if we are also using
15 # vnode_if.h, due to a bug in the system makefiles where the empty string
16 # gets expanded to a ".o" entry in OBJS, which there is (correctly) no
17 # rule to make.  For simplicity, just set this as all of what would
18 # otherwise be AFS_OS_OBJS so that people have a familiar list to look for.
19 #
20 # OS specific "object" files:
21 SRCS+= \
22         osi_crypto.c \
23         osi_gcpags.c \
24         osi_groups.c \
25         osi_file.c \
26         osi_inode.c \
27         osi_misc.c \
28         osi_sleep.c \
29         osi_vcache.c \
30         osi_vm.c \
31         osi_vnodeops.c \
32         osi_module.c
33
34 #AFS_OS_NFSOBJS = \
35 #       osi_vfsops_nfs.o
36
37 AFS_OS_NONFSOBJS = \
38         osi_vfsops.o
39
40 # System specific build commands and flags
41 KSRC = @BSD_KERNEL_PATH@
42 KBLD = @BSD_KERNEL_BUILD@
43
44 LIBAFS_REQ_DIRS = $(DESTDIR)$(KMODDIR)/
45
46 # keep symbols if --enable-debug-kernel
47 AC_DEBUG_FLAGS = @DEBUG_FLAGS@
48 .if !empty(AC_DEBUG_FLAGS)
49 DEBUG_FLAGS=    ${AC_DEBUG_FLAGS}
50
51 # For debug builds, we also need /usr/lib/debug/* dirs to exist
52 LIBAFS_REQ_DIRS += ${DESTDIR}${KERN_DEBUGDIR}${KMODDIR}/
53 .endif
54
55 # We are not doing very well (WARNS=2 brings in printf format type checking)
56 WARNS= 1
57 # We have some sketchy code that redeclares prototypes
58 CWARNFLAGS+= -Wno-redundant-decls
59
60 # setup for bsd.kmod.mk infrastructure
61 .PATH:  ${TOP_SRCDIR}/afs/FBSD
62 KMODDIR=/boot/modules
63 KERN_DEBUGDIR=/usr/lib/debug
64 KMOD=   libafs
65 SYSDIR= ${KSRC}
66 .if !empty(KBLD)
67 KERNBUILDDIR=${KBLD}
68 .endif
69
70 # Name of directory to hold object files and libraries.
71 KOBJ = MODLOAD
72
73 # This tells Makefile.common to use it's single directory build target.
74 COMPDIRS = single_compdir
75 INSTDIRS = single_instdir
76 DESTDIRS = single_destdir
77
78 # The common sysincludes code needs the 'h' symlink.
79 # We cannot include bsd.kmod.mk in this file directly, because it will start
80 # generating headers and objects in this directory, which we want in $(KOBJ).
81 # We also need the install target from bsd.kmod.mk in $(KOBJ), but the one
82 # from Makefile.common in this directory.  A prime candidate for cleanup.
83 setup:
84         -mkdir $(KOBJ)
85         -$(RM) $(KOBJ)/Makefile $(KOBJ)/Makefile.common
86         $(CP) Makefile $(KOBJ)/Makefile
87         echo ".include <bsd.kmod.mk>" >> $(KOBJ)/Makefile
88         sed -e 's/^install:/afsinstall:/' Makefile.common > $(KOBJ)/Makefile.common
89         -$(RM) -f h
90         -ln -fs ${KSRC}/sys h
91
92 # Makefile.common sets AFSAOBJS, COMMON_INCLUDE, TOP_{SRC,OBJ}*, and the like.
93 # We must live with its other pollution of targets and build rules.
94 include Makefile.common
95
96 # we only do the no-NFS case
97 OBJS=   ${AFSAOBJS} ${AFSNONFSOBJS}
98
99 LIBAFSNONFS=    libafs.ko
100 DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT
101 CFLAGS+= $(DEFINES) ${COMMON_INCLUDE}
102
103 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
104 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
105
106 DEST_LIBAFS = ${DEST}/root.client/bin/${LIBAFS}
107 DEST_LIBAFSNONFS = ${DEST}/root.client/bin/${LIBAFSNONFS}
108
109 $(DESTDIR)$(KMODDIR)/:
110         $(INSTALL) -d $@
111
112 ${DESTDIR}${KERN_DEBUGDIR}${KMODDIR}/:
113         $(INSTALL) -d $@
114
115 install_libafs: $(LIBAFSNONFS) $(LIBAFS_REQ_DIRS) install
116
117 dest_libafs: $(LIBAFSNONFS)
118         ${INSTALL} -d ${DEST}/root.client/bin
119         ${INSTALL} -m 644 $(LIBAFSNONFS) $(DEST_LIBAFSNONFS)
120
121 # This is ugly, but the common infrastructure needs a libafs target.
122 libafs: depend $(LIBAFSNONFS)
123