diff --git a/Makefile.include b/Makefile.include
index ec150b30f026c44a598fd8c6dcc55899746d548f..8fe6fc825b58de69a1de3d96dd9cc86c784b73e9 100644
--- a/Makefile.include
+++ b/Makefile.include
@@ -152,7 +152,12 @@ ifeq ($(origin RIOT_VERSION), undefined)
     RIOT_VERSION := "UNKNOWN (builddir: $(RIOTBASE))"
   endif
 endif
+
+ifneq (,$(RIOT_VERSION_OVERRIDE))
+export CFLAGS += -DRIOT_VERSION=\"$(RIOT_VERSION_OVERRIDE)\"
+else
 export CFLAGS += -DRIOT_VERSION=\"$(RIOT_VERSION)\"
+endif
 
 # the binaries to link
 BASELIBS += $(BINDIR)$(BOARD)_base.a