mirror of
https://github.com/versity/scoutfs.git
synced 2026-02-07 19:20:44 +00:00
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>
25 lines
443 B
Makefile
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
|