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
9 include @TOP_OBJDIR@/src/config/Makefile.config
11 # rx_event is miscompiled by gcc at -O0, causing panic on startup
12 .if empty(${CFLAGS:M-O})
16 # tell bsd.kmod.mk to build us vnode_if*
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.
25 # OS specific "object" files:
45 # System specific build commands and flags
46 KSRC = @BSD_KERNEL_PATH@
47 KBLD = @BSD_KERNEL_BUILD@
49 # keep symbols if --enable-debug-kernel
50 DEBUG_FLAGS = @DEBUG_FLAGS@
52 # We are not doing very well (WARNS=2 brings in printf format type checking)
54 # We have some sketchy code that redeclares prototypes
55 CWARNFLAGS+= -Wno-redundant-decls
57 # setup for bsd.kmod.mk infrastructure
58 .PATH: ${TOP_SRCDIR}/afs/FBSD
63 # Name of directory to hold object files and libraries.
66 # This tells Makefile.common to use it's single directory build target.
67 COMPDIRS = single_compdir
68 INSTDIRS = single_instdir
69 DESTDIRS = single_destdir
71 # The common sysincludes code needs the 'h' symlink.
72 # We cannot include bsd.kmod.mk in this file directly, because it will start
73 # generating headers and objects in this directory, which we want in $(KOBJ).
74 # We also need the install target from bsd.kmod.mk in $(KOBJ), but the one
75 # from Makefile.common in this directory. A prime candidate for cleanup.
78 -$(RM) $(KOBJ)/Makefile $(KOBJ)/Makefile.common
79 $(CP) Makefile $(KOBJ)/Makefile
80 echo ".include <bsd.kmod.mk>" >> $(KOBJ)/Makefile
81 sed -e 's/^install:/afsinstall:/' Makefile.common > $(KOBJ)/Makefile.common
85 # Makefile.common sets AFSAOBJS, COMMON_INCLUDE, TOP_{SRC,OBJ}*, and the like.
86 # We must live with its other pollution of targets and build rules.
87 include Makefile.common
89 # we only do the no-NFS case
90 OBJS= ${AFSAOBJS} ${AFSNONFSOBJS}
92 LIBAFSNONFS= libafs.ko
93 DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT
94 CFLAGS+= $(DEFINES) ${COMMON_INCLUDE} -I@/sys -Imachine
96 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
97 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
99 DEST_LIBAFS = ${DEST}/root.client/bin/${LIBAFS}
100 DEST_LIBAFSNONFS = ${DEST}/root.client/bin/${LIBAFSNONFS}
102 install_libafs: $(LIBAFSNONFS) install
104 dest_libafs: $(LIBAFSNONFS)
105 ${INSTALL} -d ${DEST}/root.client/bin
106 ${INSTALL} -m 644 $(LIBAFSNONFS) $(DEST_LIBAFSNONFS)
108 # This is ugly, but the common infrastructure needs a libafs target.
109 libafs: depend $(LIBAFSNONFS)