Lines Matching +full:target +full:- +full:module
9 # EXPORT_SYMS A list of symbols that should be exported from the module,
14 # KMOD The name of the kernel module to build.
18 # KMODOWN Module file owner. [${BINOWN}]
20 # KMODGRP Module file group. [${BINGRP}]
22 # KMODMODE Module file mode. [${BINMODE}]
24 # KMODLOAD Command to load a kernel module [/sbin/kldload]
26 # KMODUNLOAD Command to unload a kernel module [/sbin/kldunload]
28 # KMODISLOADED Command to check whether a kernel module is
29 # loaded [/sbin/kldstat -q -n]
31 # PROG The name of the kernel module to build.
42 # DESTDIR The tree where the module gets installed. [not set]
48 # the module. These are precious and not removed in make clean.
53 # install the kernel module; if the Makefile
54 # does not itself define the target install, the targets
56 # actions immediately before and after the install target
60 # Load a module.
63 # Unload a module.
72 KMODISLOADED?= /sbin/kldstat -q -n
75 XARGS_J?= -J
89 .if !empty(CFLAGS:M-O[23s]) && empty(CFLAGS:M-fno-strict-aliasing)
90 CFLAGS+= -fno-strict-aliasing
92 WERROR?= -Werror
111 -I${SYSDIR}/compat/linuxkpi/common/include \
112 -I${SYSDIR}/compat/linuxkpi/dummy/include \
113 -include ${SYSDIR}/compat/linuxkpi/common/include/linux/kconfig.h
116 CFLAGS+= -D_KERNEL
117 CFLAGS+= -DKLD_MODULE
119 CFLAGS+= -DKLD_TIED
122 # Don't use any standard or source-relative include directories.
123 NOSTDINC= -nostdinc
124 CFLAGS:= ${CFLAGS:N-I*} ${NOSTDINC} ${INCLMAGIC} ${CFLAGS:M-I*}
126 CFLAGS+= -DHAVE_KERNEL_OPTION_HEADERS -include ${KERNBUILDDIR}/opt_global.h
129 CFLAGS+= -include ${.OBJDIR}/opt_global.h
132 # Add -I paths for system headers. Individual module makefiles don't
133 # need any -I paths for this. Similar defaults for .PATH can't be
134 # set because there are no standard paths for non-headers.
135 CFLAGS+= -I. -I${SYSDIR} -I${SYSDIR}/contrib/ck/include
137 CFLAGS.gcc+= -finline-limit=${INLINE_LIMIT}
138 CFLAGS.gcc+= -fms-extensions
139 CFLAGS.gcc+= --param inline-unit-growth=100
140 CFLAGS.gcc+= --param large-function-growth=1000
143 # somewhere unexpected, allocate storage for them in the module itself.
145 # -fno-common is the default for src builds, but this should be left in place
146 # until at least we catch up to GCC10/LLVM11 or otherwise enable -fno-common
147 # in <bsd.sys.mk> instead. For now, we will have duplicate -fno-common in
148 # CFLAGS for in-tree module builds as they will also pick it up from
149 # share/mk/src.sys.mk, but the following is important for out-of-tree modules
151 CFLAGS+= -fno-common
153 # lld >= 14 warns that -d is deprecated, and will be removed.
154 LDFLAGS+= -d
156 LDFLAGS+= -warn-common
158 .if defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mbuild-id}
159 LDFLAGS+= --build-id=sha1
165 CFLAGS+= -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
170 CFLAGS+= -fPIC
177 LDFLAGS+= --no-relax
183 CFLAGS.clang+= -mno-movt
184 CFLAGS.clang+= -mfpu=none
185 CFLAGS+= -funwind-tables
189 CFLAGS+= -mlongcall -fno-omit-frame-pointer
192 LDFLAGS+= --no-toc-optimize
197 CTFFLAGS+= -g
202 ${AWK} -f ${SYSDIR}/tools/fw_stub.awk ${FIRMWS} -m${KMOD} -c${KMOD:S/$/.c/g} \
203 ${FIRMWARE_LICENSE:C/.+/-l/}${FIRMWARE_LICENSE}
211 ${CC:N${CCACHE_BIN}} -c -x assembler-with-cpp -DLOCORE \
213 -DFIRMW_FILE=\""${.ALLSRC:M*${_firmw:C/\:.*$//}}"\" \
214 -DFIRMW_SYMBOL="${_firmw:C/\:.*$//:C/[-.\/@]/_/g}" \
215 ${SYSDIR}/kern/firmw.S -o ${.TARGET}
237 ${OBJCOPY} --strip-debug --add-gnu-debuglink=${PROG}.debug \
238 ${FULLPROG} ${.TARGET}
240 ${OBJCOPY} --only-keep-debug ${FULLPROG} ${.TARGET}
245 ${LD} -m ${LD_EMULATION} -Bshareable -znotext -znorelro ${_LDFLAGS} \
246 -o ${.TARGET} ${KMOD}.kld
248 ${OBJCOPY} --strip-debug ${.TARGET}
258 LDSCRIPT_FLAGS?= -T ${SYSDIR}/conf/ldscript.kmod.${MACHINE}
266 ${LD} -m ${LD_EMULATION} ${_LDFLAGS} ${LDSCRIPT_FLAGS} -r \
267 -o ${.TARGET} ${OBJS} ${BLOB_OBJS}
269 ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} ${BLOB_OBJS}
278 grep -v '^#' < ${EXPORT_SYMS} > export_syms
280 ${AWK} -f ${SYSDIR}/conf/kmod_syms.awk ${.TARGET} \
281 export_syms | ${XARGS} ${XARGS_J} % ${OBJCOPY} % ${.TARGET}
285 ${AWK} -v prefix=${PREFIX_SYMS} -f ${SYSDIR}/conf/kmod_syms_prefix.awk \
286 ${.TARGET} /dev/null | ${XARGS} ${XARGS_J} % ${OBJCOPY} % ${.TARGET}
289 ${OBJCOPY} --strip-debug ${.TARGET}
314 CFLAGS+= -fdebug-prefix-map=./machine=${SYSDIR}/${MACHINE}/include
316 CFLAGS+= -fdebug-prefix-map=./${_link}=${SYSDIR}/${_link}/include
323 @case ${.TARGET} in \
327 path=${SYSDIR}/${.TARGET:T}/include ;; \
330 ${ECHO} ${.TARGET:T} "->" $$path ; \
331 ln -fns $$path ${.TARGET:T}
339 .if !target(install)
346 .if !target(realinstall)
351 ${INSTALL} -T release -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \
354 ${INSTALL} -T dbg -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \
368 cat -l >> ${METALOG}
371 .endif # !target(realinstall)
373 .endif # !target(install)
375 .if !target(load)
377 ${KMODLOAD} -v ${.OBJDIR}/${PROG}
380 .if !target(unload)
382 if ${KMODISLOADED} ${PROG} ; then ${KMODUNLOAD} -v ${PROG} ; fi
385 .if !target(reload)
391 CFLAGS+= -I${KERNBUILDDIR}
394 .if !target(${_src})
396 ln -sf ${KERNBUILDDIR}/${_src} ${.TARGET}
402 .if !target(${_src})
404 :> ${.TARGET}
417 # Respect configuration-specific C flags.
423 ${AWK} -f ${SYSDIR}/tools/vnode_if.awk ${SYSDIR}/kern/vnode_if.src -c
431 ${AWK} -f ${SYSDIR}/tools/vnode_if.awk ${SYSDIR}/kern/vnode_if.src -h
433 ${AWK} -f ${SYSDIR}/tools/vnode_if.awk ${SYSDIR}/kern/vnode_if.src -p
435 ${AWK} -f ${SYSDIR}/tools/vnode_if.awk ${SYSDIR}/kern/vnode_if.src -q
451 ${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${.IMPSRC} -c
454 ${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${.IMPSRC} -h
460 ${AWK} -f ${SYSDIR}/tools/${_i}devs2h.awk ${SYSDIR}/dev/${_i}/${_i}devs
471 ${SYSDIR}/dev/bhnd/nvram/nvram_map -h
481 ${SYSDIR}/dev/bhnd/nvram/nvram_map -d
487 ${AWK} -f ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs -h
493 ${AWK} -f ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs -d
499 ${AWK} -f ${SYSDIR}/tools/sdiodevs2h.awk ${SYSDIR}/dev/sdio/sdiodevs -h
505 ${AWK} -f ${SYSDIR}/tools/sdiodevs2h.awk ${SYSDIR}/dev/sdio/sdiodevs -d
511 ${AWK} -f ${SYSDIR}/tools/acpi_quirks2h.awk ${SYSDIR}/dev/acpica/acpi_quirks
529 sh ${SYSDIR}/kern/genassym.sh genassym.o > ${.TARGET}
532 ${CC} -c ${NOSAN_CFLAGS:N-flto*:N-fno-common} -fcommon \
535 sh ${SYSDIR}/kern/genoffset.sh genoffset.o > ${.TARGET}
538 ${CC} -c ${NOSAN_CFLAGS:N-flto*:N-fno-common} -fcommon \
544 rm -f ${_ILINKS}
553 -D_SYS_VMEM_H_ \
554 -D__KERNEL__ \
555 -nostdinc \
556 -DSMP \
557 -I${ZINCDIR} \
558 -I${ZINCDIR}/os/freebsd \
559 -I${ZINCDIR}/os/freebsd/spl \
560 -I${ZINCDIR}/os/freebsd/zfs \
561 -I${SYSDIR}/cddl/compat/opensolaris \
562 -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
563 -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h
566 .include <bsd.clang-analyze.mk>