2016-08-08 00:16:06 +02:00
|
|
|
ifndef VERBOSE
|
|
|
|
.SILENT:
|
|
|
|
endif
|
|
|
|
|
2016-08-09 08:52:01 +02:00
|
|
|
ifdef silent
|
|
|
|
SILENT = $(silent)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef SILENT
|
|
|
|
SUB_IS_SILENT := $(silent)
|
|
|
|
endif
|
|
|
|
|
|
|
|
override SILENT = false
|
|
|
|
|
2016-08-16 07:42:08 +02:00
|
|
|
ON_ERROR := error_occured=1
|
|
|
|
|
2016-08-01 08:23:37 +02:00
|
|
|
STARTING_MAKEFILE := $(firstword $(MAKEFILE_LIST))
|
|
|
|
ROOT_MAKEFILE := $(lastword $(MAKEFILE_LIST))
|
2016-08-07 17:30:58 +02:00
|
|
|
ROOT_DIR := $(dir $(ROOT_MAKEFILE))
|
2016-08-03 08:28:47 +02:00
|
|
|
ifeq ($(ROOT_DIR),)
|
|
|
|
ROOT_DIR := .
|
|
|
|
endif
|
2016-08-01 08:23:37 +02:00
|
|
|
ABS_STARTING_MAKEFILE := $(abspath $(STARTING_MAKEFILE))
|
|
|
|
ABS_ROOT_MAKEFILE := $(abspath $(ROOT_MAKEFILE))
|
|
|
|
ABS_STARTING_DIR := $(dir $(ABS_STARTING_MAKEFILE))
|
|
|
|
ABS_ROOT_DIR := $(dir $(ABS_ROOT_MAKEFILE))
|
|
|
|
STARTING_DIR := $(subst $(ABS_ROOT_DIR),,$(ABS_STARTING_DIR))
|
|
|
|
|
|
|
|
PATH_ELEMENTS := $(subst /, ,$(STARTING_DIR))
|
|
|
|
|
2016-08-07 16:04:39 +02:00
|
|
|
MAKEFILE_INCLUDED=yes
|
2016-08-07 15:45:33 +02:00
|
|
|
|
2016-08-01 08:23:37 +02:00
|
|
|
define NEXT_PATH_ELEMENT
|
|
|
|
$$(eval CURRENT_PATH_ELEMENT := $$(firstword $$(PATH_ELEMENTS)))
|
|
|
|
$$(eval PATH_ELEMENTS := $$(wordlist 2,9999,$$(PATH_ELEMENTS)))
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call NEXT_PATH_ELEMENT))
|
|
|
|
|
|
|
|
ifeq ($(CURRENT_PATH_ELEMENT),keyboards)
|
|
|
|
$(eval $(call NEXT_PATH_ELEMENT))
|
|
|
|
KEYBOARD := $(CURRENT_PATH_ELEMENT)
|
|
|
|
$(eval $(call NEXT_PATH_ELEMENT))
|
|
|
|
ifeq ($(CURRENT_PATH_ELEMENT),keymaps)
|
|
|
|
$(eval $(call NEXT_PATH_ELEMENT))
|
|
|
|
KEYMAP := $(CURRENT_PATH_ELEMENT)
|
|
|
|
else ifneq ($(CURRENT_PATH_ELEMENT),)
|
|
|
|
SUBPROJECT := $(CURRENT_PATH_ELEMENT)
|
|
|
|
$(eval $(call NEXT_PATH_ELEMENT))
|
|
|
|
ifeq ($(CURRENT_PATH_ELEMENT),keymaps)
|
|
|
|
$(eval $(call NEXT_PATH_ELEMENT))
|
|
|
|
KEYMAP := $(CURRENT_PATH_ELEMENT)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2016-08-07 17:12:45 +02:00
|
|
|
# Only consider folders with makefiles, to prevent errors in case there are extra folders
|
|
|
|
KEYBOARDS := $(notdir $(patsubst %/Makefile,%,$(wildcard $(ROOT_DIR)/keyboards/*/Makefile)))
|
2016-08-03 08:28:47 +02:00
|
|
|
|
2016-08-07 17:54:12 +02:00
|
|
|
#Compability with the old make variables
|
|
|
|
ifdef keyboard
|
|
|
|
KEYBOARD := $(keyboard)
|
|
|
|
endif
|
|
|
|
ifdef sub
|
|
|
|
SUBPROJECT := $(sub)
|
|
|
|
endif
|
|
|
|
ifdef subproject
|
|
|
|
SUBPROJECT := $(subproject)
|
|
|
|
endif
|
|
|
|
ifdef keymap
|
|
|
|
KEYMAP := $(keymap)
|
|
|
|
endif
|
|
|
|
|
2016-08-09 08:52:01 +02:00
|
|
|
#$(info Keyboard: $(KEYBOARD))
|
|
|
|
#$(info Keymap: $(KEYMAP))
|
|
|
|
#$(info Subproject: $(SUBPROJECT))
|
|
|
|
#$(info Keyboards: $(KEYBOARDS))
|
2016-08-03 08:28:47 +02:00
|
|
|
|
2016-08-07 18:22:21 +02:00
|
|
|
.DEFAULT_GOAL := all
|
2016-08-07 18:16:44 +02:00
|
|
|
ifneq ($(KEYMAP),)
|
|
|
|
ifeq ($(SUBPROJECT),)
|
|
|
|
.DEFAULT_GOAL := $(KEYBOARD)-$(KEYMAP)
|
|
|
|
else
|
|
|
|
.DEFAULT_GOAL := $(KEYBOARD)-$(SUBPROJECT)-$(KEYMAP)
|
|
|
|
endif
|
|
|
|
else ifneq ($(SUBPROJECT),)
|
|
|
|
.DEFAULT_GOAL := $(KEYBOARD)-$(SUBPROJECT)-allkm
|
|
|
|
else ifneq ($(KEYBOARD),)
|
|
|
|
.DEFAULT_GOAL := $(KEYBOARD)-allsp-allkm
|
|
|
|
endif
|
|
|
|
|
2016-08-01 08:23:37 +02:00
|
|
|
|
2016-08-03 07:44:11 +02:00
|
|
|
# Compare the start of the RULE_VARIABLE with the first argument($1)
|
|
|
|
# If the rules equals $1 or starts with $1-, RULE_FOUND is set to true
|
|
|
|
# and $1 is removed from the RULE variable
|
|
|
|
# Otherwise the RULE_FOUND variable is set to false
|
|
|
|
# The function is a bit tricky, since there's no built in $(startswith) function
|
2016-08-07 14:56:41 +02:00
|
|
|
define COMPARE_AND_REMOVE_FROM_RULE_HELPER
|
2016-08-03 07:44:11 +02:00
|
|
|
ifeq ($1,$$(RULE))
|
|
|
|
RULE:=
|
|
|
|
RULE_FOUND := true
|
|
|
|
else
|
|
|
|
STARTDASH_REMOVED=$$(subst START$1-,,START$$(RULE))
|
|
|
|
ifneq ($$(STARTDASH_REMOVED),START$$(RULE))
|
|
|
|
RULE_FOUND := true
|
|
|
|
RULE := $$(STARTDASH_REMOVED)
|
|
|
|
else
|
|
|
|
RULE_FOUND := false
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endef
|
|
|
|
|
2016-08-07 14:56:41 +02:00
|
|
|
COMPARE_AND_REMOVE_FROM_RULE = $(eval $(call COMPARE_AND_REMOVE_FROM_RULE_HELPER,$1))$(RULE_FOUND)
|
|
|
|
|
|
|
|
|
2016-08-04 08:17:02 +02:00
|
|
|
# Recursively try to find a match
|
|
|
|
# $1 The list to be checked
|
|
|
|
# If a match is found, then RULE_FOUND is set to true
|
|
|
|
# and MATCHED_ITEM to the item that was matched
|
2016-08-07 14:56:41 +02:00
|
|
|
define TRY_TO_MATCH_RULE_FROM_LIST_HELPER
|
2016-08-07 13:33:49 +02:00
|
|
|
ifneq ($1,)
|
2016-08-07 14:56:41 +02:00
|
|
|
ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,$$(firstword $1)),true)
|
2016-08-07 13:33:49 +02:00
|
|
|
MATCHED_ITEM := $$(firstword $1)
|
|
|
|
else
|
2016-08-07 14:56:41 +02:00
|
|
|
$$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER,$$(wordlist 2,9999,$1)))
|
2016-08-07 13:33:49 +02:00
|
|
|
endif
|
2016-08-04 08:17:02 +02:00
|
|
|
endif
|
|
|
|
endef
|
|
|
|
|
2016-08-07 14:56:41 +02:00
|
|
|
TRY_TO_MATCH_RULE_FROM_LIST = $(eval $(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER,$1))$(RULE_FOUND)
|
|
|
|
|
2016-08-04 08:56:03 +02:00
|
|
|
define ALL_IN_LIST_LOOP
|
|
|
|
OLD_RULE$1 := $$(RULE)
|
|
|
|
$$(eval $$(call $1,$$(ITEM$1)))
|
|
|
|
RULE := $$(OLD_RULE$1)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define PARSE_ALL_IN_LIST
|
|
|
|
$$(foreach ITEM$1,$2,$$(eval $$(call ALL_IN_LIST_LOOP,$1)))
|
|
|
|
endef
|
2016-08-04 08:17:02 +02:00
|
|
|
|
2016-08-07 15:02:14 +02:00
|
|
|
define PARSE_RULE
|
|
|
|
RULE := $1
|
|
|
|
COMMANDS :=
|
|
|
|
ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkb),true)
|
|
|
|
$$(eval $$(call PARSE_ALL_KEYBOARDS))
|
|
|
|
else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYBOARDS)),true)
|
|
|
|
$$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM)))
|
2016-08-07 17:30:58 +02:00
|
|
|
else ifneq ($$(KEYBOARD),)
|
|
|
|
$$(eval $$(call PARSE_KEYBOARD,$$(KEYBOARD)))
|
2016-08-07 17:15:45 +02:00
|
|
|
else
|
|
|
|
$$(info make: *** No rule to make target '$1'. Stop.)
|
|
|
|
exit 1
|
2016-08-07 15:02:14 +02:00
|
|
|
endif
|
2016-08-04 08:56:03 +02:00
|
|
|
endef
|
|
|
|
|
2016-08-07 15:02:14 +02:00
|
|
|
# $1 = Keyboard
|
|
|
|
define PARSE_KEYBOARD
|
|
|
|
CURRENT_KB := $1
|
|
|
|
# A subproject is any keyboard subfolder with a makefile
|
|
|
|
SUBPROJECTS := $$(notdir $$(patsubst %/Makefile,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/*/Makefile)))
|
|
|
|
ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allsp),true)
|
|
|
|
$$(eval $$(call PARSE_ALL_SUBPROJECTS))
|
2016-08-07 15:45:33 +02:00
|
|
|
else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,defaultsp),true)
|
|
|
|
$$(eval $$(call PARSE_SUBPROJECT,defaultsp))
|
2016-08-07 15:02:14 +02:00
|
|
|
else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(SUBPROJECTS)),true)
|
|
|
|
$$(eval $$(call PARSE_SUBPROJECT,$$(MATCHED_ITEM)))
|
2016-08-07 20:28:14 +02:00
|
|
|
else ifneq ($$(SUBPROJECT),)
|
|
|
|
$$(eval $$(call PARSE_SUBPROJECT,$$(SUBPROJECT)))
|
2016-08-07 15:45:33 +02:00
|
|
|
else
|
|
|
|
# If there's no matching subproject, we assume it's the default
|
|
|
|
# This will allow you to leave the subproject part of the target out
|
|
|
|
$$(eval $$(call PARSE_SUBPROJECT,defaultsp))
|
2016-08-07 15:02:14 +02:00
|
|
|
endif
|
2016-08-03 07:44:11 +02:00
|
|
|
endef
|
|
|
|
|
2016-08-07 15:02:14 +02:00
|
|
|
define PARSE_ALL_KEYBOARDS
|
|
|
|
$$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYBOARD,$(KEYBOARDS)))
|
2016-08-07 13:33:49 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
# $1 Subproject
|
|
|
|
define PARSE_SUBPROJECT
|
2016-08-07 15:45:33 +02:00
|
|
|
ifeq ($1,defaultsp)
|
2016-08-07 16:48:59 +02:00
|
|
|
SUBPROJECT_DEFAULT=
|
2016-08-07 15:45:33 +02:00
|
|
|
$$(eval include $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/Makefile)
|
|
|
|
CURRENT_SP := $$(SUBPROJECT_DEFAULT)
|
|
|
|
else
|
|
|
|
CURRENT_SP := $1
|
|
|
|
endif
|
2016-08-07 16:48:59 +02:00
|
|
|
# If current subproject is empty (the default was not defined), and we have a list of subproject
|
|
|
|
# then make all
|
|
|
|
ifeq ($$(CURRENT_SP),)
|
|
|
|
ifneq ($$(SUBPROJECTS),)
|
|
|
|
CURRENT_SP := allsp
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
ifneq ($$(CURRENT_SP),allsp)
|
|
|
|
KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/keymaps/*/.)))
|
|
|
|
ifneq ($$(CURRENT_SP),)
|
|
|
|
SP_KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/$$(CURRENT_SP)/keymaps/*/.)))
|
|
|
|
KEYMAPS := $$(sort $$(KEYMAPS) $$(SP_KEYMAPS))
|
|
|
|
endif
|
2016-08-07 20:28:14 +02:00
|
|
|
ifeq ($$(RULE),)
|
|
|
|
$$(eval $$(call PARSE_ALL_KEYMAPS))
|
|
|
|
else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkm),true)
|
2016-08-07 16:48:59 +02:00
|
|
|
$$(eval $$(call PARSE_ALL_KEYMAPS))
|
|
|
|
else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYMAPS)),true)
|
|
|
|
$$(eval $$(call PARSE_KEYMAP,$$(MATCHED_ITEM)))
|
2016-08-07 20:28:14 +02:00
|
|
|
else ifneq ($$(KEYMAP),)
|
|
|
|
$$(eval $$(call PARSE_KEYMAP,$$(KEYMAP)))
|
2016-08-07 17:12:45 +02:00
|
|
|
else
|
|
|
|
ifeq ($$(CURRENT_SP),)
|
|
|
|
$$(info make: *** No rule to make target '$$(CURRENT_KB)-$$(RULE)'. Stop.)
|
|
|
|
else
|
|
|
|
$$(info make: *** No rule to make target '$$(CURRENT_KB)-$$(CURRENT_SP)-$$(RULE)'. Stop.)
|
|
|
|
endif
|
|
|
|
exit 1
|
2016-08-07 16:48:59 +02:00
|
|
|
endif
|
|
|
|
else
|
|
|
|
$$(eval $$(call PARSE_ALL_IN_LIST,PARSE_SUBPROJECT,$(SUBPROJECTS)))
|
2016-08-04 07:49:44 +02:00
|
|
|
endif
|
|
|
|
endef
|
|
|
|
|
2016-08-07 15:02:14 +02:00
|
|
|
define PARSE_ALL_SUBPROJECTS
|
|
|
|
ifeq ($$(SUBPROJECTS),)
|
2016-08-07 15:45:33 +02:00
|
|
|
$$(eval $$(call PARSE_SUBPROJECT,defaultsp))
|
2016-08-07 15:02:14 +02:00
|
|
|
else
|
|
|
|
$$(eval $$(call PARSE_ALL_IN_LIST,PARSE_SUBPROJECT,$$(SUBPROJECTS)))
|
2016-08-07 13:33:49 +02:00
|
|
|
endif
|
|
|
|
endef
|
|
|
|
|
2016-08-04 08:17:02 +02:00
|
|
|
# $1 Keymap
|
2016-08-04 07:49:44 +02:00
|
|
|
define PARSE_KEYMAP
|
2016-08-04 08:17:02 +02:00
|
|
|
CURRENT_KM = $1
|
2016-08-14 11:25:23 +02:00
|
|
|
# The rest of the rule is the target
|
|
|
|
# Remove the leading "-" from the target, as it acts as a separator
|
|
|
|
MAKE_TARGET := $$(patsubst -%,%,$$(RULE))
|
2016-08-08 00:16:06 +02:00
|
|
|
COMMAND := COMMAND_KEYBOARD_$$(CURRENT_KB)_SUBPROJECT_$(CURRENT_SP)_KEYMAP_$$(CURRENT_KM)
|
|
|
|
COMMANDS += $$(COMMAND)
|
|
|
|
ifeq ($$(CURRENT_SP),)
|
|
|
|
KB_SP := $(CURRENT_KB)
|
|
|
|
else
|
|
|
|
KB_SP := $(CURRENT_KB)/$$(CURRENT_SP)
|
|
|
|
endif
|
|
|
|
KB_SP := $(BOLD)$$(KB_SP)$(NO_COLOR)
|
2016-08-08 09:26:23 +02:00
|
|
|
MAKE_VARS := KEYBOARD=$$(CURRENT_KB) SUBPROJECT=$$(CURRENT_SP) KEYMAP=$$(CURRENT_KM)
|
2016-08-09 08:52:01 +02:00
|
|
|
MAKE_VARS += VERBOSE=$(VERBOSE) COLOR=$(COLOR)
|
2016-08-14 11:25:23 +02:00
|
|
|
MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_keyboard.mk $$(MAKE_TARGET)
|
|
|
|
MAKE_MSG := Making $$(KB_SP) with keymap $(BOLD)$$(CURRENT_KM)$(NO_COLOR)
|
|
|
|
ifneq ($$(MAKE_TARGET),)
|
|
|
|
MAKE_MSG += and target $(BOLD)$$(MAKE_TARGET)$(NO_COLOR)
|
|
|
|
endif
|
2016-08-09 08:52:01 +02:00
|
|
|
MAKE_MSG_FORMAT := $(AWK) '{ printf "%-118s", $$$$0;}'
|
|
|
|
COMMAND_true_$$(COMMAND) := \
|
|
|
|
printf "$$(MAKE_MSG)" | \
|
|
|
|
$$(MAKE_MSG_FORMAT); \
|
2016-08-11 08:34:23 +02:00
|
|
|
LOG=$$$$($$(MAKE_CMD) $$(MAKE_VARS) SILENT=true 2>&1) ; \
|
2016-08-08 09:26:23 +02:00
|
|
|
if [ $$$$? -gt 0 ]; \
|
|
|
|
then $$(PRINT_ERROR_PLAIN); \
|
|
|
|
elif [ "$$$$LOG" != "" ] ; \
|
|
|
|
then $$(PRINT_WARNING_PLAIN); \
|
|
|
|
else \
|
|
|
|
$$(PRINT_OK); \
|
|
|
|
fi;
|
2016-08-09 08:52:01 +02:00
|
|
|
COMMAND_false_$$(COMMAND) := \
|
2016-08-16 07:57:10 +02:00
|
|
|
printf "$$(MAKE_MSG)\n\n"; \
|
2016-08-11 08:34:23 +02:00
|
|
|
$$(MAKE_CMD) $$(MAKE_VARS) SILENT=false;
|
2016-08-04 07:49:44 +02:00
|
|
|
endef
|
2016-08-03 08:28:47 +02:00
|
|
|
|
2016-08-07 15:02:14 +02:00
|
|
|
define PARSE_ALL_KEYMAPS
|
|
|
|
$$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYMAP,$$(KEYMAPS)))
|
2016-08-03 07:44:11 +02:00
|
|
|
endef
|
|
|
|
|
2016-08-09 08:52:01 +02:00
|
|
|
define SET_SILENT_MODE
|
|
|
|
ifdef SUB_IS_SILENT
|
|
|
|
SILENT_MODE := $(SUB_IS_SILENT)
|
|
|
|
else ifeq ($$(words $$(COMMANDS)),1)
|
|
|
|
SILENT_MODE := false
|
|
|
|
else
|
|
|
|
SILENT_MODE := true
|
|
|
|
endif
|
|
|
|
endef
|
|
|
|
|
2016-08-08 00:16:06 +02:00
|
|
|
include $(ROOT_DIR)/message.mk
|
|
|
|
|
|
|
|
RUN_COMMAND = \
|
2016-08-09 08:52:01 +02:00
|
|
|
$(COMMAND_$(SILENT_MODE)_$(COMMAND))
|
2016-08-03 07:44:11 +02:00
|
|
|
|
2016-08-07 20:28:14 +02:00
|
|
|
# Allow specifying just the subproject, in the keyboard directory, which will compile all keymaps
|
|
|
|
SUBPROJECTS := $(notdir $(patsubst %/Makefile,%,$(wildcard ./*/Makefile)))
|
|
|
|
.PHONY: $(SUBPROJECTS)
|
|
|
|
$(SUBPROJECTS): %: %-allkm
|
|
|
|
|
2016-08-03 07:44:11 +02:00
|
|
|
.PHONY: %
|
2016-08-08 09:26:23 +02:00
|
|
|
%:
|
|
|
|
cmp --version >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi;
|
2016-08-08 10:19:29 +02:00
|
|
|
git submodule status --recursive 2>/dev/null | \
|
|
|
|
while IFS= read -r x; do \
|
|
|
|
case "$$x" in \
|
|
|
|
\ *) ;; \
|
|
|
|
*) printf "$(MSG_SUBMODULE_DIRTY)";break;; \
|
|
|
|
esac \
|
|
|
|
done
|
2016-08-03 07:44:11 +02:00
|
|
|
$(eval $(call PARSE_RULE,$@))
|
2016-08-09 08:52:01 +02:00
|
|
|
$(eval $(call SET_SILENT_MODE))
|
2016-08-16 07:42:08 +02:00
|
|
|
+error_occured=0; \
|
|
|
|
$(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND)) \
|
|
|
|
if [ $$error_occured -gt 0 ]; then printf "$(MSG_ERRORS)" & exit $$error_occured; fi
|
2016-08-08 09:26:23 +02:00
|
|
|
|
2016-08-03 07:44:11 +02:00
|
|
|
|
2016-08-07 18:16:44 +02:00
|
|
|
.PHONY: all
|
2016-08-07 18:22:21 +02:00
|
|
|
all: all-keyboards
|
2016-08-07 18:16:44 +02:00
|
|
|
|
2016-08-03 07:44:11 +02:00
|
|
|
.PHONY: all-keyboards
|
2016-08-07 18:22:21 +02:00
|
|
|
all-keyboards: allkb-allsp-allkm
|
2016-08-03 07:44:11 +02:00
|
|
|
|
|
|
|
.PHONY: all-keyboards-defaults
|
2016-08-07 18:22:21 +02:00
|
|
|
all-keyboards-defaults: allkb-allsp-default
|
2016-08-08 00:16:06 +02:00
|
|
|
|
2016-08-08 10:19:29 +02:00
|
|
|
|
|
|
|
GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
|
|
|
|
BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S")
|
|
|
|
$(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(ROOT_DIR)/quantum/version.h)
|
|
|
|
$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(ROOT_DIR)/quantum/version.h)
|