Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time

#ifdef STRING_GIT_VERSION
#define STRING_CONFIG_H_AUTHOR STRING_GIT_VERSION
#endif

#ifndef STRING_CONFIG_H_AUTHOR
#define STRING_CONFIG_H_AUTHOR "Version DEV" // Who made the changes.
#endif
Expand Down
19 changes: 17 additions & 2 deletions Marlin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ UPLOAD_PORT ?= /dev/arduino
#Directory used to build files in, contains all the build files, from object files to the final hex file.
BUILD_DIR ?= applet

# Use git-revisions for builds
# Release version
GIT_VERSION=$(shell git describe --tags --exact-match --dirty 2> /dev/null)
ifeq ($(strip $(GIT_VERSION)), )
# Dev version
GIT_VERSION=$(shell git describe --tags --dirty 2> /dev/null)
endif
# Fallback if the above for some reason fail
ifeq ($(strip $(GIT_VERSION)), )
GIT_VERSION=$(shell git describe --always 2> /dev/null)
endif
ifneq ($(strip $(GIT_VERSION)), )
GITVER='-D STRING_GIT_VERSION="$(GIT_VERSION)"'
endif

############################################################################
# Below here nothing should be changed...

Expand Down Expand Up @@ -284,8 +299,8 @@ CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD}
endif
#CEXTRA = -Wa,-adhlns=$(<:.c=.lst)

CFLAGS := $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CEXTRA) $(CTUNING)
CXXFLAGS := $(CDEFS) $(CINCS) -O$(OPT) -Wall $(CEXTRA) $(CTUNING)
CFLAGS := $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CEXTRA) $(CTUNING) $(GITVER)
CXXFLAGS := $(CDEFS) $(CINCS) -O$(OPT) -Wall $(CEXTRA) $(CTUNING) $(GITVER)
#ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
LDFLAGS = -lm

Expand Down
4 changes: 4 additions & 0 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@ void setup()
SERIAL_ECHOLNPGM(STRING_CONFIG_H_AUTHOR);
SERIAL_ECHOPGM("Compiled: ");
SERIAL_ECHOLNPGM(__DATE__);
#ifdef STRING_GIT_VERSION
SERIAL_ECHOPGM("Git version: ");
SERIAL_ECHOLNPGM(STRING_GIT_VERSION);
#endif
#endif
#endif
SERIAL_ECHO_START;
Expand Down