From 8b94e26d7c3b30cc57d710a11e5651d15e8e3b20 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sun, 24 Jul 2016 22:07:43 -0400 Subject: Fixes midi functionality --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a7a10bf32..980ab26b2 100644 --- a/Makefile +++ b/Makefile @@ -181,7 +181,7 @@ endif ifeq ($(strip $(MIDI_ENABLE)), yes) OPT_DEFS += -DMIDI_ENABLE - SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c + SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c endif ifeq ($(strip $(AUDIO_ENABLE)), yes) -- cgit v1.2.3 From 79067662c8c71129a84a41b0147edc63b33db709 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 31 Jul 2016 13:22:18 +0300 Subject: Better "include guards" for the makefiles Checking for ARCH is not good enough, since some subprojects define it. Ergodox Ez for example. The leads to running the make from keyboards/ergodox/ez failing. The keyboard makefile will not be included in that case, and therefore not the CUSTOM_MATRIX either. Furthermore the output files are read from many different .build directories, so it doesn't fail deterministically. For example on the Travis CI the compilation passes, since there's no outdated objects that needs recompilation. --- Makefile | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 980ab26b2..31826f14a 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,9 @@ endif .DEFAULT_GOAL := all space := $(subst ,, ) -starting_makefile := $(subst $(space),_SPACE_,$(abspath $(firstword $(MAKEFILE_LIST)))) -mkfile_path := $(subst $(space),_SPACE_,$(abspath $(lastword $(MAKEFILE_LIST)))) +ESCAPED_ABS_PATH = $(subst $(space),_SPACE_,$(abspath $1)) +starting_makefile := $(call ESCAPED_ABS_PATH,$(firstword $(MAKEFILE_LIST))) +mkfile_path := $(call ESCAPED_ABS_PATH,$(lastword $(MAKEFILE_LIST)))) abs_tmk_root := $(patsubst %/,%,$(dir $(mkfile_path))) ifneq (,$(findstring /keyboards/,$(starting_makefile))) @@ -83,10 +84,8 @@ endif ifneq ("$(wildcard $(KEYBOARD_PATH)/$(KEYBOARD).c)","") KEYBOARD_FILE = keyboards/$(KEYBOARD)/$(KEYBOARD).c - ifndef ARCH - ifneq ("$(wildcard $(KEYBOARD_PATH)/Makefile)","") - include $(KEYBOARD_PATH)/Makefile - endif + ifneq ($(call ESCAPED_ABS_PATH,$(KEYBOARD_PATH)/Makefile),$(starting_makefile)) + -include $(KEYBOARD_PATH)/Makefile endif else $(error "$(KEYBOARD_PATH)/$(KEYBOARD).c" does not exist) @@ -101,7 +100,9 @@ ifdef SUBPROJECT ifneq ("$(wildcard $(SUBPROJECT_PATH)/$(SUBPROJECT).c)","") OPT_DEFS += -DSUBPROJECT_$(SUBPROJECT) SUBPROJECT_FILE = keyboards/$(KEYBOARD)/$(SUBPROJECT)/$(SUBPROJECT).c - -include $(SUBPROJECT_PATH)/Makefile + ifneq ($(call ESCAPED_ABS_PATH,$(SUBPROJECT_PATH)/Makefile),$(starting_makefile)) + -include $(SUBPROJECT_PATH)/Makefile + endif else $(error "$(SUBPROJECT_PATH)/$(SUBPROJECT).c" does not exist) endif @@ -119,14 +120,18 @@ endif KEYMAP_PATH = $(KEYBOARD_PATH)/keymaps/$(KEYMAP) ifneq ("$(wildcard $(KEYMAP_PATH)/keymap.c)","") KEYMAP_FILE = keyboards/$(KEYBOARD)/keymaps/$(KEYMAP)/keymap.c - -include $(KEYMAP_PATH)/Makefile + ifneq ($(call ESCAPED_ABS_PATH,$(KEYMAP_PATH)/Makefile),$(starting_makefile)) + -include $(KEYMAP_PATH)/Makefile + endif else ifeq ("$(wildcard $(SUBPROJECT_PATH)/keymaps/$(KEYMAP)/keymap.c)","") $(error "$(KEYMAP_PATH)/keymap.c" does not exist) else KEYMAP_PATH = $(SUBPROJECT_PATH)/keymaps/$(KEYMAP) KEYMAP_FILE = keyboards/$(KEYBOARD)/$(SUBPROJECT)/keymaps/$(KEYMAP)/keymap.c - -include $(KEYMAP_PATH)/Makefile + ifneq ($(call ESCAPED_ABS_PATH,$(KEYMAP_PATH)/Makefile),$(starting_makefile)) + -include $(KEYMAP_PATH)/Makefile + endif endif endif -- cgit v1.2.3 From abdf42573ac6e01432fdf69847f4259540c1a38d Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 31 Jul 2016 13:25:49 +0300 Subject: Put the build output inside the root/.build directory --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 31826f14a..60c7a6ef6 100644 --- a/Makefile +++ b/Makefile @@ -140,7 +140,8 @@ ifdef SUBPROJECT else TARGET ?= $(KEYBOARD)_$(KEYMAP) endif -BUILD_DIR = .build + +BUILD_DIR = $(TOP_DIR)/.build # Object files directory # To put object files in current directory, use a dot (.), do NOT make -- cgit v1.2.3 From 97817a773eb667045144ac820df673ed8d3471a0 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 30 Jul 2016 23:41:26 +0300 Subject: Generate version information to version.h So that only the files that really needs a version are recompiled. --- .gitignore | 3 ++- Makefile | 4 +++- keyboards/ergodox/keymaps/algernon/keymap.c | 1 + keyboards/ergodox/keymaps/default/keymap.c | 1 + keyboards/ergodox/keymaps/josh/keymap.c | 1 + keyboards/planck/keymaps/cbbrowne/keymap.c | 1 + keyboards/planck/keymaps/experimental/keymap.c | 1 + 7 files changed, 10 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/.gitignore b/.gitignore index 849143352..8c85d6ffa 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ build/ .build/ *.bak .vagrant/ +quantum/version.h .idea/ CMakeLists.txt .DS_STORE @@ -26,4 +27,4 @@ CMakeLists.txt .project .settings/ .idea -.browse.VC.db* \ No newline at end of file +.browse.VC.db* diff --git a/Makefile b/Makefile index 60c7a6ef6..053c8532a 100644 --- a/Makefile +++ b/Makefile @@ -271,4 +271,6 @@ include $(TMK_PATH)/rules.mk 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") OPT_DEFS += -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\" -OPT_DEFS += -DQMK_VERSION=\"$(GIT_VERSION)\" -DQMK_BUILDDATE=\"$(BUILD_DATE)\" + +$(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(QUANTUM_PATH)/version.h) +$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(QUANTUM_PATH)/version.h) \ No newline at end of file diff --git a/keyboards/ergodox/keymaps/algernon/keymap.c b/keyboards/ergodox/keymaps/algernon/keymap.c index 6a14ef467..c4de53da2 100644 --- a/keyboards/ergodox/keymaps/algernon/keymap.c +++ b/keyboards/ergodox/keymaps/algernon/keymap.c @@ -12,6 +12,7 @@ #include "keymap_plover.h" #include "eeconfig.h" #include "wait.h" +#include "version.h" /* Layers */ diff --git a/keyboards/ergodox/keymaps/default/keymap.c b/keyboards/ergodox/keymaps/default/keymap.c index f1a83f4e7..1b80cb3a2 100644 --- a/keyboards/ergodox/keymaps/default/keymap.c +++ b/keyboards/ergodox/keymaps/default/keymap.c @@ -1,6 +1,7 @@ #include "ergodox.h" #include "debug.h" #include "action_layer.h" +#include "version.h" #define BASE 0 // default layer #define SYMB 1 // symbols diff --git a/keyboards/ergodox/keymaps/josh/keymap.c b/keyboards/ergodox/keymaps/josh/keymap.c index 488b21427..b5463873a 100644 --- a/keyboards/ergodox/keymaps/josh/keymap.c +++ b/keyboards/ergodox/keymaps/josh/keymap.c @@ -1,6 +1,7 @@ #include "ergodox.h" #include "debug.h" #include "action_layer.h" +#include "version.h" #define BASE 0 // default layer #define SYMB 1 // symbols diff --git a/keyboards/planck/keymaps/cbbrowne/keymap.c b/keyboards/planck/keymaps/cbbrowne/keymap.c index 14a5be170..70eaefb7b 100644 --- a/keyboards/planck/keymaps/cbbrowne/keymap.c +++ b/keyboards/planck/keymaps/cbbrowne/keymap.c @@ -4,6 +4,7 @@ #endif #include "config.h" #include "quantum.h" +#include "version.h" /* Each layer is given a name to aid in readability, which is then used in the keymap matrix below. The underscores do not denote diff --git a/keyboards/planck/keymaps/experimental/keymap.c b/keyboards/planck/keymaps/experimental/keymap.c index d9303fcae..2c1270094 100644 --- a/keyboards/planck/keymaps/experimental/keymap.c +++ b/keyboards/planck/keymaps/experimental/keymap.c @@ -8,6 +8,7 @@ #endif #include "eeconfig.h" +#include "version.h" extern keymap_config_t keymap_config; -- cgit v1.2.3