mirror of
https://github.com/versity/scoutfs.git
synced 2026-02-08 03:30:46 +00:00
It's handy to quickly find the git commit that built a given module. We add a MOD_INFO() tag for it so we can see it in modinfo on the built module. We add a ELF note that the kernel tracks in /sys/modules/$m/notes/ when the module is loaded. Signed-off-by: Zach Brown <zab@versity.com>
30 lines
646 B
Makefile
30 lines
646 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
|
|
|
|
SCOUTFS_GIT_DESCRIBE := \
|
|
$(shell git describe --all --abbrev=6 --long 2>/dev/null || \
|
|
echo not-in-a-git-repository)
|
|
|
|
SCOUTFS_ARGS := SCOUTFS_GIT_DESCRIBE=$(SCOUTFS_GIT_DESCRIBE) \
|
|
CONFIG_SCOUTFS_FS=m -C $(SK_KSRC) M=$(CURDIR)/src
|
|
|
|
all: module
|
|
|
|
module:
|
|
make $(SCOUTFS_ARGS)
|
|
$(SP) make C=2 CF="-D__CHECK_ENDIAN__" $(SCOUTFS_ARGS)
|
|
|
|
clean:
|
|
make $(SCOUTFS_ARGS) clean
|