summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml1
-rw-r--r--Makefile713
-rw-r--r--build_keyboard.mk221
-rw-r--r--keyboards/alps64/Makefile69
-rw-r--r--keyboards/alps64/rules.mk66
-rw-r--r--keyboards/amj60/Makefile71
-rw-r--r--keyboards/amj60/rules.mk66
-rw-r--r--keyboards/arrow_pad/Makefile73
-rw-r--r--keyboards/arrow_pad/readme.md8
-rw-r--r--keyboards/arrow_pad/rules.mk70
-rw-r--r--keyboards/atomic/Makefile72
-rw-r--r--keyboards/atomic/readme.md7
-rw-r--r--keyboards/atomic/rules.mk69
-rw-r--r--keyboards/atreus/Makefile89
-rw-r--r--keyboards/atreus/readme.md7
-rw-r--r--keyboards/atreus/rules.mk82
-rw-r--r--keyboards/bantam44/Makefile73
-rw-r--r--keyboards/bantam44/readme.md7
-rw-r--r--keyboards/bantam44/rules.mk67
-rw-r--r--keyboards/chibios_test/Makefile11
-rw-r--r--keyboards/chibios_test/rules.mk8
-rw-r--r--keyboards/chibios_test/stm32_f072_onekey/Makefile42
-rw-r--r--keyboards/chibios_test/stm32_f072_onekey/rules.mk41
-rw-r--r--keyboards/chibios_test/stm32_f103_onekey/Makefile53
-rw-r--r--keyboards/chibios_test/stm32_f103_onekey/rules.mk52
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/Makefile48
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/rules.mk49
-rw-r--r--keyboards/clueboard/Makefile108
-rw-r--r--keyboards/clueboard/readme.md26
-rw-r--r--keyboards/clueboard/rev1/Makefile6
-rw-r--r--keyboards/clueboard/rev1/rules.mk5
-rw-r--r--keyboards/clueboard/rev2/Makefile6
-rw-r--r--keyboards/clueboard/rev2/rules.mk5
-rw-r--r--keyboards/clueboard/rules.mk103
-rw-r--r--keyboards/cluecard/Makefile77
-rw-r--r--keyboards/cluecard/readme.md6
-rw-r--r--keyboards/cluecard/rules.mk70
-rw-r--r--keyboards/cluepad/Makefile71
-rw-r--r--keyboards/cluepad/rules.mk65
-rw-r--r--keyboards/ergodox/Makefile33
-rw-r--r--keyboards/ergodox/ez/Makefile77
-rw-r--r--keyboards/ergodox/ez/rules.mk76
-rw-r--r--keyboards/ergodox/infinity/Makefile78
-rw-r--r--keyboards/ergodox/infinity/rules.mk77
-rw-r--r--keyboards/ergodox/readme.md12
-rw-r--r--keyboards/ergodox/rules.mk28
-rw-r--r--keyboards/gh60/Makefile77
-rw-r--r--keyboards/gh60/readme.md8
-rw-r--r--keyboards/gh60/rules.mk66
-rw-r--r--keyboards/handwired/CMD60/Makefile74
-rw-r--r--keyboards/handwired/CMD60/rules.mk73
-rw-r--r--keyboards/handwired/Makefile2
-rw-r--r--keyboards/handwired/fivethirteen/Makefile74
-rw-r--r--keyboards/handwired/fivethirteen/rules.mk73
-rw-r--r--keyboards/handwired/minorca/Makefile70
-rw-r--r--keyboards/handwired/minorca/rules.mk67
-rw-r--r--keyboards/handwired/onekey/Makefile64
-rw-r--r--keyboards/handwired/onekey/rules.mk65
-rw-r--r--keyboards/handwired/rules.mk0
-rw-r--r--keyboards/handwired/traveller/Makefile90
-rw-r--r--keyboards/handwired/traveller/rules.mk89
-rw-r--r--keyboards/hhkb/Makefile91
-rw-r--r--keyboards/hhkb/readme.md8
-rw-r--r--keyboards/hhkb/rules.mk84
-rw-r--r--keyboards/infinity_chibios/Makefile69
-rw-r--r--keyboards/infinity_chibios/rules.mk66
-rw-r--r--keyboards/jd45/Makefile72
-rw-r--r--keyboards/jd45/rules.mk67
-rw-r--r--keyboards/kc60/Makefile76
-rw-r--r--keyboards/kc60/readme.md12
-rw-r--r--keyboards/kc60/rules.mk71
-rw-r--r--keyboards/kinesis/Makefile80
-rw-r--r--keyboards/kinesis/readme.md6
-rw-r--r--keyboards/kinesis/rules.mk73
-rw-r--r--keyboards/kitten_paw/Makefile76
-rw-r--r--keyboards/kitten_paw/rules.mk72
-rw-r--r--keyboards/lets_split/Makefile77
-rw-r--r--keyboards/lets_split/rules.mk74
-rw-r--r--keyboards/phantom/Makefile75
-rw-r--r--keyboards/phantom/rules.mk69
-rw-r--r--keyboards/planck/Makefile71
-rw-r--r--keyboards/planck/readme.md8
-rw-r--r--keyboards/planck/rev3/Makefile4
-rw-r--r--keyboards/planck/rev3/rules.mk5
-rw-r--r--keyboards/planck/rev4/Makefile4
-rw-r--r--keyboards/planck/rev4/rules.mk5
-rw-r--r--keyboards/planck/rules.mk67
-rw-r--r--keyboards/preonic/Makefile72
-rw-r--r--keyboards/preonic/readme.md8
-rw-r--r--keyboards/preonic/rules.mk69
-rw-r--r--keyboards/retro_refit/Makefile75
-rw-r--r--keyboards/retro_refit/readme.md8
-rw-r--r--keyboards/retro_refit/rules.mk68
-rw-r--r--keyboards/s60-x/Makefile76
-rw-r--r--keyboards/s60-x/readme.md4
-rw-r--r--keyboards/s60-x/rules.mk69
-rw-r--r--keyboards/satan/Makefile71
-rw-r--r--keyboards/satan/rules.mk66
-rw-r--r--keyboards/sixkeyboard/Makefile76
-rw-r--r--keyboards/sixkeyboard/rules.mk70
-rw-r--r--keyboards/tv44/Makefile76
-rw-r--r--keyboards/tv44/readme.md6
-rw-r--r--keyboards/tv44/rules.mk69
-rw-r--r--keyboards/vision_division/Makefile77
-rw-r--r--keyboards/vision_division/rules.mk70
-rw-r--r--message.mk71
-rw-r--r--quantum/template/Makefile76
-rw-r--r--quantum/template/rules.mk67
-rw-r--r--readme.md102
-rw-r--r--tmk_core/chibios.mk12
-rw-r--r--tmk_core/common.mk3
-rw-r--r--tmk_core/common/command.c3
-rw-r--r--tmk_core/rules.mk256
-rw-r--r--util/install_dependencies.sh12
114 files changed, 3664 insertions, 3306 deletions
diff --git a/.travis.yml b/.travis.yml
index 297cf19a68..138a2c5532 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,4 +21,5 @@ addons:
- gcc-arm-none-eabi
- binutils-arm-none-eabi
- libnewlib-arm-none-eabi
+ - diffutils
after_success: bash util/travis_compiled_push.sh
diff --git a/Makefile b/Makefile
index 331badcf84..f78cca6c6f 100644
--- a/Makefile
+++ b/Makefile
@@ -2,284 +2,461 @@ ifndef VERBOSE
.SILENT:
endif
-.DEFAULT_GOAL := all
-
-space := $(subst ,, )
-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)))
- possible_keyboard:=$(patsubst %/,%,$(dir $(patsubst $(abs_tmk_root)/keyboards/%,%,$(starting_makefile))))
- ifneq (,$(findstring /keymaps/,$(possible_keyboard)))
- KEYMAP_DIR:=$(lastword $(subst /keymaps/, ,$(possible_keyboard)))
- KEYBOARD_DIR:=$(firstword $(subst /keymaps/, ,$(possible_keyboard)))
- ifneq (,$(findstring /,$(KEYBOARD_DIR)))
- # SUBPROJECT_DIR:=$(lastword $(subst /, ,$(KEYBOARD_DIR)))
- # KEYBOARD_DIR:=$(firstword $(subst /, ,$(KEYBOARD_DIR)))
- tmk_root = ../../..
- else
- tmk_root = ../../../..
- endif
- else
- KEYMAP_DIR:=default
- KEYBOARD_DIR:=$(possible_keyboard)
- ifneq (,$(findstring /,$(KEYBOARD_DIR)))
- # SUBPROJECT_DIR:=$(lastword $(subst /, ,$(KEYBOARD_DIR)))
- # KEYBOARD_DIR:=$(firstword $(subst /, ,$(KEYBOARD_DIR)))
- tmk_root = ../../..
- else
- tmk_root = ../..
- endif
- endif
-else
- tmk_root = .
-endif
-# $(info $(KEYBOARD_DIR))
-# $(info $(KEYMAP_DIR))
-# $(info $(SUBPROJECT_DIR))
-
-# Directory common source filess exist
-TOP_DIR = $(tmk_root)
-TMK_DIR = tmk_core
-TMK_PATH = $(TOP_DIR)/$(TMK_DIR)
-LIB_PATH = $(TOP_DIR)/lib
-
-QUANTUM_DIR = quantum
-QUANTUM_PATH = $(TOP_DIR)/$(QUANTUM_DIR)
-
-
+# Allow the silent with lower caps to work the same way as upper caps
+ifdef silent
+ SILENT = $(silent)
+endif
+
+ifdef SILENT
+ SUB_IS_SILENT := $(SILENT)
+endif
+
+# We need to make sure that silent is always turned off at the top level
+# Otherwise the [OK], [ERROR] and [WARN] messags won't be displayed correctly
+override SILENT := false
+
+ON_ERROR := error_occured=1
+
+STARTING_MAKEFILE := $(firstword $(MAKEFILE_LIST))
+ROOT_MAKEFILE := $(lastword $(MAKEFILE_LIST))
+ROOT_DIR := $(dir $(ROOT_MAKEFILE))
+ifeq ($(ROOT_DIR),)
+ ROOT_DIR := .
+endif
+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))
+
+MAKEFILE_INCLUDED=yes
+
+# Helper function to process the newt element of a space separated path
+# It works a bit like the traditional functional head tail
+# so the CURRENT_PATH_ELEMENT will beome the new head
+# and the PATH_ELEMENTS are the rest that are still unprocessed
+define NEXT_PATH_ELEMENT
+ $$(eval CURRENT_PATH_ELEMENT := $$(firstword $$(PATH_ELEMENTS)))
+ $$(eval PATH_ELEMENTS := $$(wordlist 2,9999,$$(PATH_ELEMENTS)))
+endef
+
+# We change the / to spaces so that we more easily can work with the elements
+# separately
+PATH_ELEMENTS := $(subst /, ,$(STARTING_DIR))
+# Initialize the path elements list for further processing
+$(eval $(call NEXT_PATH_ELEMENT))
+
+# This function sets the KEYBOARD; KEYMAP and SUBPROJECT to the correct
+# variables depending on which directory you stand in.
+# It's really a very simple if else chain, if you squint enough,
+# but the makefile syntax makes it very verbose.
+# If we are in a subfolder of keyboards
+ifeq ($(CURRENT_PATH_ELEMENT),keyboards)
+ $(eval $(call NEXT_PATH_ELEMENT))
+ KEYBOARD := $(CURRENT_PATH_ELEMENT)
+ $(eval $(call NEXT_PATH_ELEMENT))
+ # If we are in a subfolder of keymaps, or in other words in a keymap
+ # folder
+ ifeq ($(CURRENT_PATH_ELEMENT),keymaps)
+ $(eval $(call NEXT_PATH_ELEMENT))
+ KEYMAP := $(CURRENT_PATH_ELEMENT)
+ # else if we are not in the keyboard folder itself
+ else ifneq ($(CURRENT_PATH_ELEMENT),)
+ # the we can assume it's a subproject, as no other folders
+ # should have make files in them
<