linux-core Makefile: add GIT_REVISION
This tries to automatically fetch a git revision string and if succeeds, it #defines GIT_REVISION string macro. Packagers can override it by 'make GIT_REVISION=foo'. Update Nouveau to use GIT_REVISION, if defined, instead of DRIVER_DATE in struct drm_driver. Signed-off-by: Pekka Paalanen <pq@iki.fi>main
parent
ce8c842518
commit
b3967765c0
|
@ -335,6 +335,11 @@ ifneq (,$(findstring i915,$(DRM_MODULES)))
|
|||
CONFIG_DRM_I915 := m
|
||||
endif
|
||||
|
||||
GIT_REVISION := $(shell cd "$(DRMSRCDIR)" && git-describe --abbrev=17)
|
||||
ifneq ($(GIT_REVISION),)
|
||||
EXTRA_CFLAGS+=-D"GIT_REVISION=\"$(GIT_REVISION)\""
|
||||
endif
|
||||
|
||||
include $(DRMSRCDIR)/Makefile.kernel
|
||||
|
||||
# Depencencies
|
||||
|
|
|
@ -86,7 +86,11 @@ static struct drm_driver driver = {
|
|||
|
||||
.name = DRIVER_NAME,
|
||||
.desc = DRIVER_DESC,
|
||||
#ifdef GIT_REVISION
|
||||
.date = GIT_REVISION,
|
||||
#else
|
||||
.date = DRIVER_DATE,
|
||||
#endif
|
||||
.major = DRIVER_MAJOR,
|
||||
.minor = DRIVER_MINOR,
|
||||
.patchlevel = DRIVER_PATCHLEVEL,
|
||||
|
|
Loading…
Reference in New Issue