a3f2bffcba19369f3e4fe9a5b618b8430300aaac
[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 # rx_event is miscompiled by gcc at -O0, causing panic on startup
12 .if empty(${CFLAGS:M-O})
13 CFLAGS+=        -O
14 .endif
15
16 # tell bsd.kmod.mk to build us vnode_if*
17 SRCS=   vnode_if.h
18
19 # We must set SRCS to include at least one .c file if we are also using
20 # vnode_if.h, due to a bug in the system makefiles where the empty string
21 # gets expanded to a ".o" entry in OBJS, which there is (correctly) no
22 # rule to make.  For simplicity, just set this as all of what would
23 # otherwise be AFS_OS_OBJS so that people have a familiar list to look for.
24 #
25 # OS specific "object" files:
26 SRCS+= \
27         osi_crypto.c \
28         osi_gcpags.c \
29         osi_groups.c \
30         osi_file.c \
31         osi_inode.c \
32         osi_misc.c \
33         osi_sleep.c \
34         osi_vcache.c \
35         osi_vm.c \
36         osi_vnodeops.c \
37         osi_module.c
38
39 #AFS_OS_NFSOBJS = \
40 #       osi_vfsops_nfs.o
41
42 AFS_OS_NONFSOBJS = \
43         osi_vfsops.o
44
45 # System specific build commands and flags
46 KSRC = @BSD_KERNEL_PATH@
47 KBLD = @BSD_KERNEL_BUILD@
48
49 # keep symbols if --enable-debug-kernel
50 AC_DEBUG_FLAGS = @DEBUG_FLAGS@
51 .if !empty(AC_DEBUG_FLAGS)
52 DEBUG_FLAGS=    ${AC_DEBUG_FLAGS}
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 KMOD=   libafs
64 SYSDIR= ${KSRC}
65
66 # Name of directory to hold object files and libraries.
67 KOBJ = MODLOAD
68
69 # This tells Makefile.common to use it's single directory build target.
70 COMPDIRS = single_compdir
71 INSTDIRS = single_instdir
72 DESTDIRS = single_destdir
73
74 # The common sysincludes code needs the 'h' symlink.
75 # We cannot include bsd.kmod.mk in this file directly, because it will start
76 # generating headers and objects in this directory, which we want in $(KOBJ).
77 # We also need the install target from bsd.kmod.mk in $(KOBJ), but the one
78 # from Makefile.common in this directory.  A prime candidate for cleanup.
79 setup:
80         -mkdir $(KOBJ)
81         -$(RM) $(KOBJ)/Makefile $(KOBJ)/Makefile.common
82         $(CP) Makefile $(KOBJ)/Makefile
83         echo ".include <bsd.kmod.mk>" >> $(KOBJ)/Makefile
84         sed -e 's/^install:/afsinstall:/' Makefile.common > $(KOBJ)/Makefile.common
85         -$(RM) -f h
86         -ln -fs ${KSRC}/sys h
87
88 # Makefile.common sets AFSAOBJS, COMMON_INCLUDE, TOP_{SRC,OBJ}*, and the like.
89 # We must live with its other pollution of targets and build rules.
90 include Makefile.common
91
92 # we only do the no-NFS case
93 OBJS=   ${AFSAOBJS} ${AFSNONFSOBJS}
94
95 LIBAFSNONFS=    libafs.ko
96 DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT
97 CFLAGS+= $(DEFINES) ${COMMON_INCLUDE} -I@/sys -Imachine
98
99 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
100 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
101
102 DEST_LIBAFS = ${DEST}/root.client/bin/${LIBAFS}
103 DEST_LIBAFSNONFS = ${DEST}/root.client/bin/${LIBAFSNONFS}
104
105 install_libafs: $(LIBAFSNONFS) install
106
107 dest_libafs: $(LIBAFSNONFS)
108         ${INSTALL} -d ${DEST}/root.client/bin
109         ${INSTALL} -m 644 $(LIBAFSNONFS) $(DEST_LIBAFSNONFS)
110
111 # This is ugly, but the common infrastructure needs a libafs target.
112 libafs: depend $(LIBAFSNONFS)
113