summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile77
1 files changed, 21 insertions, 56 deletions
diff --git a/Makefile b/Makefile
index 8c70e76f4b..1763611ab8 100644
--- a/Makefile
+++ b/Makefile
@@ -264,11 +264,20 @@ define PARSE_RULE
else
$$(info make: *** No rule to make target '$1'. Stop.)
$$(info |)
- $$(info | QMK's make format recently changed to use folder locations and colons:)
- $$(info | make project_folder:keymap[:target])
- $$(info | Examples:)
- $$(info | make planck/ez:default:flash)
- $$(info | make planck/ez:default)
+ $$(info | QMK's make format is:)
+ $$(info | make keyboard_folder:keymap_folder[:target])
+ $$(info |)
+ $$(info | Where `keyboard_folder` is the path to the keyboard relative to)
+ $$(info | `qmk_firmware/keyboards/`, and `keymap_folder` is the name of the)
+ $$(info | keymap folder under that board's `keymaps/` directory.)
+ $$(info |)
+ $$(info | Examples:)
+ $$(info | keyboards/dz60, keyboards/dz60/keymaps/default)
+ $$(info | -> make dz60:default)
+ $$(info | -> qmk compile -kb dz60 -km default)
+ $$(info | keyboards/planck/rev6, keyboards/planck/keymaps/default)
+ $$(info | -> make planck/rev6:default:flash)
+ $$(info | -> qmk flash -kb planck/rev6 -km default)
$$(info |)
endif
endef
@@ -306,37 +315,8 @@ define PARSE_KEYBOARD
KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_3)/keymaps/*/.)))
KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_4)/keymaps/*/.)))
KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_5)/keymaps/*/.)))
- # this might be needed, but in a different form
- #KEYMAPS := $$(sort $$(filter-out $$(KEYBOARD_FOLDER_1) $$(KEYBOARD_FOLDER_2) \
- $$(KEYBOARD_FOLDER_3) $$(KEYBOARD_FOLDER_4) $$(KEYBOARD_FOLDER_5), $$(KEYMAPS)))
-
- KEYBOARD_LAYOUTS :=
- ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_5)/rules.mk)","")
- LAYOUTS :=
- $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_5)/rules.mk)
- KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS))
- endif
- ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_4)/rules.mk)","")
- LAYOUTS :=
- $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_4)/rules.mk)
- KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS))
- endif
- ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_3)/rules.mk)","")
- LAYOUTS :=
- $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_3)/rules.mk)
- KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS))
- endif
- ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_2)/rules.mk)","")
- LAYOUTS :=
- $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_2)/rules.mk)
- KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS))
- endif
- ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_1)/rules.mk)","")
- LAYOUTS :=
- $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_1)/rules.mk)
- KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS))
- endif
+ KEYBOARD_LAYOUTS := $(shell $(QMK_BIN) list-layouts --keyboard $1)
LAYOUT_KEYMAPS :=
$$(foreach LAYOUT,$$(KEYBOARD_LAYOUTS),$$(eval LAYOUT_KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/layouts/*/$$(LAYOUT)/*/.)))))
@@ -560,29 +540,14 @@ git-submodule:
git submodule sync --recursive
git submodule update --init --recursive --progress
-ifdef SKIP_VERSION
-SKIP_GIT := yes
-endif
-
# Generate the version.h file
-ifndef SKIP_GIT
- GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
- CHIBIOS_VERSION := $(shell cd lib/chibios && git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
- CHIBIOS_CONTRIB_VERSION := $(shell cd lib/chibios-contrib && git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
-else
- GIT_VERSION := NA
- CHIBIOS_VERSION := NA
- CHIBIOS_CONTRIB_VERSION := NA
+ifdef SKIP_GIT
+VERSION_H_FLAGS := --skip-git
endif
-ifndef SKIP_VERSION
-BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S")
-else
-BUILD_DATE := 2020-01-01-00:00:00
+ifdef SKIP_VERSION
+VERSION_H_FLAGS := --skip-all
+SKIP_GIT := yes
endif
-
-$(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(ROOT_DIR)/quantum/version.h)
-$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(ROOT_DIR)/quantum/version.h)
-$(shell echo '#define CHIBIOS_VERSION "$(CHIBIOS_VERSION)"' >> $(ROOT_DIR)/quantum/version.h)
-$(shell echo '#define CHIBIOS_CONTRIB_VERSION "$(CHIBIOS_CONTRIB_VERSION)"' >> $(ROOT_DIR)/quantum/version.h)
+$(shell $(QMK_BIN) generate-version-h $(VERSION_H_FLAGS) -q -o quantum/version.h)
include $(ROOT_DIR)/testlist.mk