Files
scoutfs/kmod/Makefile
Zach Brown 2591e54fdc Make it easier to build scoutfs.ko
We were duplicating the make args a few times so make a little ARGS
variable.

Default to the /lib/modules/$(uname -r) installed kernel source if
SK_KSRC isn't set.

And only try a sparse build that can fail if we can execute the sparse
command.

Signed-off-by: Zach Brown <zab@versity.com>
Reviewed-by: Mark Fasheh <mfasheh@versity.com>
2017-04-18 14:03:24 -07:00

25 lines
443 B
Makefile

ALL: module
# default to building against the installed source for the running kernel
ifeq ($(SK_KSRC),)
SK_KSRC := $(shell echo /lib/modules/`uname -r`/build)
endif
# fail if sparse fails if we find it
ifeq ($(shell sparse && echo found),found)
SP =
else
SP = @:
endif
ARGS := CONFIG_SCOUTFS_FS=m -C $(SK_KSRC) M=$(CURDIR)/src
all: module
module:
make $(ARGS)
$(SP) make C=2 CF="-D__CHECK_ENDIAN__" $(ARGS)
clean:
make $(ARGS) clean