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 # tell bsd.kmod.mk to build us vnode_if*
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.
20 # OS specific "object" files:
40 # System specific build commands and flags
41 KSRC = @BSD_KERNEL_PATH@
42 KBLD = @BSD_KERNEL_BUILD@
44 # keep symbols if --enable-debug-kernel
45 AC_DEBUG_FLAGS = @DEBUG_FLAGS@
46 .if !empty(AC_DEBUG_FLAGS)
47 DEBUG_FLAGS= ${AC_DEBUG_FLAGS}
50 # We are not doing very well (WARNS=2 brings in printf format type checking)
52 # We have some sketchy code that redeclares prototypes
53 CWARNFLAGS+= -Wno-redundant-decls
55 # setup for bsd.kmod.mk infrastructure
56 .PATH: ${TOP_SRCDIR}/afs/FBSD
61 # Name of directory to hold object files and libraries.
64 # This tells Makefile.common to use it's single directory build target.
65 COMPDIRS = single_compdir
66 INSTDIRS = single_instdir
67 DESTDIRS = single_destdir
69 # The common sysincludes code needs the 'h' symlink.
70 # We cannot include bsd.kmod.mk in this file directly, because it will start
71 # generating headers and objects in this directory, which we want in $(KOBJ).
72 # We also need the install target from bsd.kmod.mk in $(KOBJ), but the one
73 # from Makefile.common in this directory. A prime candidate for cleanup.
76 -$(RM) $(KOBJ)/Makefile $(KOBJ)/Makefile.common
77 $(CP) Makefile $(KOBJ)/Makefile
78 echo ".include <bsd.kmod.mk>" >> $(KOBJ)/Makefile
79 sed -e 's/^install:/afsinstall:/' Makefile.common > $(KOBJ)/Makefile.common
83 # Makefile.common sets AFSAOBJS, COMMON_INCLUDE, TOP_{SRC,OBJ}*, and the like.
84 # We must live with its other pollution of targets and build rules.
85 include Makefile.common
87 # we only do the no-NFS case
88 OBJS= ${AFSAOBJS} ${AFSNONFSOBJS}
90 LIBAFSNONFS= libafs.ko
91 DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT
92 CFLAGS+= $(DEFINES) ${COMMON_INCLUDE}
94 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
95 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
97 DEST_LIBAFS = ${DEST}/root.client/bin/${LIBAFS}
98 DEST_LIBAFSNONFS = ${DEST}/root.client/bin/${LIBAFSNONFS}
100 $(DESTDIR)$(KMODDIR)/:
103 install_libafs: $(LIBAFSNONFS) $(DESTDIR)$(KMODDIR)/ install
105 dest_libafs: $(LIBAFSNONFS)
106 ${INSTALL} -d ${DEST}/root.client/bin
107 ${INSTALL} -m 644 $(LIBAFSNONFS) $(DEST_LIBAFSNONFS)
109 # This is ugly, but the common infrastructure needs a libafs target.
110 libafs: depend $(LIBAFSNONFS)