From 86706de036cf7ad52b679b259ca8f980057d0da5 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Mon, 1 Aug 2016 09:23:37 +0300 Subject: Parsing of makefile variables from starting dir --- Makefile | 322 ++++++++------------------------------------------------------- 1 file changed, 41 insertions(+), 281 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 693edc9f0..fcd57754b 100644 --- a/Makefile +++ b/Makefile @@ -1,281 +1,41 @@ -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) - - -ifdef keyboard - KEYBOARD ?= $(keyboard) -endif -ifdef KEYBOARD_DIR - KEYBOARD ?= $(KEYBOARD_DIR) -endif -ifndef KEYBOARD - KEYBOARD=planck -endif - -MASTER ?= left -ifdef master - MASTER = $(master) -endif - - -# converts things to keyboards/subproject -ifneq (,$(findstring /,$(KEYBOARD))) - TEMP:=$(KEYBOARD) - KEYBOARD:=$(firstword $(subst /, ,$(TEMP))) - SUBPROJECT:=$(lastword $(subst /, ,$(TEMP))) -endif - -KEYBOARD_PATH = $(TOP_DIR)/keyboards/$(KEYBOARD) - -ifdef sub - SUBPROJECT=$(sub) -endif -ifdef subproject - SUBPROJECT=$(subproject) -endif - -ifneq ("$(wildcard $(KEYBOARD_PATH)/$(KEYBOARD).c)","") - KEYBOARD_FILE = keyboards/$(KEYBOARD)/$(KEYBOARD).c - ifneq ($(call ESCAPED_ABS_PATH,$(KEYBOARD_PATH)/Makefile),$(starting_makefile)) - -include $(KEYBOARD_PATH)/Makefile - endif -else -$(error "$(KEYBOARD_PATH)/$(KEYBOARD).c" does not exist) -endif - -ifdef SUBPROJECT_DEFAULT - SUBPROJECT?=$(SUBPROJECT_DEFAULT) -endif - -ifdef SUBPROJECT - SUBPROJECT_PATH = $(TOP_DIR)/keyboards/$(KEYBOARD)/$(SUBPROJECT) - ifneq ("$(wildcard $(SUBPROJECT_PATH)/$(SUBPROJECT).c)","") - OPT_DEFS += -DSUBPROJECT_$(SUBPROJECT) - SUBPROJECT_FILE = keyboards/$(KEYBOARD)/$(SUBPROJECT)/$(SUBPROJECT).c - 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 -endif - -ifdef keymap - KEYMAP ?= $(keymap) -endif -ifdef KEYMAP_DIR - KEYMAP ?= $(KEYMAP_DIR) -endif -ifndef KEYMAP - KEYMAP = default -endif -KEYMAP_PATH = $(KEYBOARD_PATH)/keymaps/$(KEYMAP) -ifneq ("$(wildcard $(KEYMAP_PATH)/keymap.c)","") - KEYMAP_FILE = keyboards/$(KEYBOARD)/keymaps/$(KEYMAP)/keymap.c - 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 - ifneq ($(call ESCAPED_ABS_PATH,$(KEYMAP_PATH)/Makefile),$(starting_makefile)) - -include $(KEYMAP_PATH)/Makefile - endif - endif -endif - -ifdef SUBPROJECT - TARGET ?= $(KEYBOARD)_$(SUBPROJECT)_$(KEYMAP) -else - TARGET ?= $(KEYBOARD)_$(KEYMAP) -endif - -BUILD_DIR = $(TOP_DIR)/.build - -# Object files directory -# To put object files in current directory, use a dot (.), do NOT make -# this an empty or blank macro! -OBJDIR = $(BUILD_DIR)/obj_$(TARGET) - - - -ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","") - CONFIG_H = $(KEYMAP_PATH)/config.h -else - CONFIG_H = $(KEYBOARD_PATH)/config.h - ifdef SUBPROJECT - ifneq ("$(wildcard $(SUBPROJECT_PATH)/$(SUBPROJECT).c)","") - CONFIG_H = $(SUBPROJECT_PATH)/config.h - endif - endif -endif - -# # project specific files -SRC += $(KEYBOARD_FILE) \ - $(KEYMAP_FILE) \ - $(QUANTUM_DIR)/quantum.c \ - $(QUANTUM_DIR)/keymap_common.c \ - $(QUANTUM_DIR)/keycode_config.c \ - $(QUANTUM_DIR)/process_keycode/process_leader.c - -ifdef SUBPROJECT - SRC += $(SUBPROJECT_FILE) -endif - -ifdef SUBPROJECT - SRC += $(SUBPROJECT_FILE) -endif - -ifdef SUBPROJECT - SRC += $(SUBPROJECT_FILE) -endif - -ifndef CUSTOM_MATRIX - SRC += $(QUANTUM_DIR)/matrix.c -endif - -ifeq ($(strip $(MIDI_ENABLE)), yes) - OPT_DEFS += -DMIDI_ENABLE - SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c -endif - -ifeq ($(strip $(AUDIO_ENABLE)), yes) - OPT_DEFS += -DAUDIO_ENABLE - SRC += $(QUANTUM_DIR)/process_keycode/process_music.c - SRC += $(QUANTUM_DIR)/audio/audio.c - SRC += $(QUANTUM_DIR)/audio/voices.c - SRC += $(QUANTUM_DIR)/audio/luts.c -endif - -ifeq ($(strip $(UCIS_ENABLE)), yes) - OPT_DEFS += -DUCIS_ENABLE - UNICODE_ENABLE = yes -endif - -ifeq ($(strip $(UNICODE_ENABLE)), yes) - OPT_DEFS += -DUNICODE_ENABLE - SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c -endif - -ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) - OPT_DEFS += -DRGBLIGHT_ENABLE - SRC += $(QUANTUM_DIR)/light_ws2812.c - SRC += $(QUANTUM_DIR)/rgblight.c -endif - -ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) - OPT_DEFS += -DTAP_DANCE_ENABLE - SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c -endif - -ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes) - SERIAL_DIR = $(QUANTUM_DIR)/serial_link - SERIAL_PATH = $(QUANTUM_PATH)/serial_link - SERIAL_SRC = $(wildcard $(SERIAL_PATH)/protocol/*.c) - SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c) - SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC)) - OPT_DEFS += -DSERIAL_LINK_ENABLE - VAPTH += $(SERIAL_PATH) -endif - -# Optimize size but this may cause error "relocation truncated to fit" -#EXTRALDFLAGS = -Wl,--relax - -# Search Path -VPATH += $(KEYMAP_PATH) -ifdef SUBPROJECT - VPATH += $(SUBPROJECT_PATH) -endif -VPATH += $(KEYBOARD_PATH) -VPATH += $(TOP_DIR) -VPATH += $(TMK_PATH) -VPATH += $(QUANTUM_PATH) -VPATH += $(QUANTUM_PATH)/keymap_extras -VPATH += $(QUANTUM_PATH)/audio -VPATH += $(QUANTUM_PATH)/process_keycode - - -# We can assume a ChibiOS target When MCU_FAMILY is defined, since it's not used for LUFA -ifdef MCU_FAMILY - PLATFORM=CHIBIOS -else - PLATFORM=AVR -endif - -include $(TMK_PATH)/common.mk -ifeq ($(PLATFORM),AVR) - include $(TMK_PATH)/protocol/lufa.mk - include $(TMK_PATH)/avr.mk -else ifeq ($(PLATFORM),CHIBIOS) - include $(TMK_PATH)/protocol/chibios.mk - include $(TMK_PATH)/chibios.mk - OPT_OS = chibios -else - $(error Unknown platform) -endif - -ifeq ($(strip $(VISUALIZER_ENABLE)), yes) - VISUALIZER_DIR = $(QUANTUM_DIR)/visualizer - VISUALIZER_PATH = $(QUANTUM_PATH)/visualizer - include $(VISUALIZER_PATH)/visualizer.mk -endif - -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)\" - -$(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(QUANTUM_PATH)/version.h) -$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(QUANTUM_PATH)/version.h) +STARTING_MAKEFILE := $(firstword $(MAKEFILE_LIST)) +ROOT_MAKEFILE := $(lastword $(MAKEFILE_LIST)) +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)) + +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 + +$(info Keyboard: $(KEYBOARD)) +$(info Keymap: $(KEYMAP)) +$(info Subproject: $(SUBPROJECT)) + + +all: + echo "Compiling" \ No newline at end of file -- cgit v1.2.3 From e6e675335dbaa6bd175be7aaee829c717e572488 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Wed, 3 Aug 2016 08:44:11 +0300 Subject: First version of rule parsing Only handles allkb at the moment. --- Makefile | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index fcd57754b..f0d5c05cc 100644 --- a/Makefile +++ b/Makefile @@ -36,6 +36,54 @@ $(info Keyboard: $(KEYBOARD)) $(info Keymap: $(KEYMAP)) $(info Subproject: $(SUBPROJECT)) +# 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 +define COMPARE_AND_REMOVE_FROM_RULE + 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 + +define PARSE_ALL_KEYBOARDS + COMMANDS += allkb + #$$(info $$(RULE)) + COMMAND_allkb := "All keyboards with $$(RULE)" +endef + +define PARSE_RULE + RULE := $1 + COMMANDS := + $$(eval $$(call COMPARE_AND_REMOVE_FROM_RULE,allkb)) + ifeq ($$(RULE_FOUND),true) + $$(eval $$(call PARSE_ALL_KEYBOARDS)) + endif +endef + +RUN_COMMAND = echo "Running": $(COMMAND_$(COMMAND)); + +.PHONY: % +%: + $(eval $(call PARSE_RULE,$@)) + $(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND)) + +.PHONY: all-keyboards +all-keyboards: allkb + +.PHONY: all-keyboards-defaults +all-keyboards-defaults: allkb-default-default +.PHONY: all all: echo "Compiling" \ No newline at end of file -- cgit v1.2.3 From f97ae2b199df087f4b48c7019c2d887089d81614 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Wed, 3 Aug 2016 09:28:47 +0300 Subject: Rule parsing to match kebyoards --- Makefile | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f0d5c05cc..b24270ad1 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,9 @@ 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)) @@ -32,9 +36,14 @@ ifeq ($(CURRENT_PATH_ELEMENT),keyboards) endif endif +$(info $(ROOT_DIR)/keyboards) +KEYBOARDS := $(notdir $(patsubst %/.,%,$(wildcard $(ROOT_DIR)/keyboards/*/.))) + $(info Keyboard: $(KEYBOARD)) $(info Keymap: $(KEYMAP)) $(info Subproject: $(SUBPROJECT)) +$(info Keyboards: $(KEYBOARDS)) + # 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 @@ -62,12 +71,34 @@ define PARSE_ALL_KEYBOARDS COMMAND_allkb := "All keyboards with $$(RULE)" endef +define PARSE_KEYBOARD + COMMANDS += $1 + #$$(info $$(RULE)) + COMMAND_$1 := "Keyboard $1 with $$(RULE)" +endef + + +# Recursively try to find a matching keyboard +# During the first call $1 contains a list of all keyboards +# One keyboard is checked and removed at a time +define TRY_PARSE_KEYBOARD + CURRENT_KB := $$(firstword $1) + $$(eval $$(call COMPARE_AND_REMOVE_FROM_RULE,$$(CURRENT_KB))) + ifeq ($$(RULE_FOUND),true) + $$(eval $$(call PARSE_KEYBOARD,$$(CURRENT_KB))) + else ifneq ($1,) + $$(eval $$(call TRY_PARSE_KEYBOARD,$$(wordlist 2,9999,$1))) + endif +endef + define PARSE_RULE RULE := $1 COMMANDS := $$(eval $$(call COMPARE_AND_REMOVE_FROM_RULE,allkb)) ifeq ($$(RULE_FOUND),true) $$(eval $$(call PARSE_ALL_KEYBOARDS)) + else + $$(eval $$(call TRY_PARSE_KEYBOARD,$(KEYBOARDS))) endif endef -- cgit v1.2.3 From 9b02e66ce0f703480e42038a5084174a45b54b1d Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Thu, 4 Aug 2016 08:49:44 +0300 Subject: Add keymap parsing --- Makefile | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b24270ad1..b4204478e 100644 --- a/Makefile +++ b/Makefile @@ -71,12 +71,28 @@ define PARSE_ALL_KEYBOARDS COMMAND_allkb := "All keyboards with $$(RULE)" endef +# $1 = Keyboard define PARSE_KEYBOARD - COMMANDS += $1 - #$$(info $$(RULE)) - COMMAND_$1 := "Keyboard $1 with $$(RULE)" + $$(eval $$(call COMPARE_AND_REMOVE_FROM_RULE,allkm)) + ifeq ($$(RULE_FOUND),true) + $$(eval $$(call PARSE_ALL_KEYMAPS, $1)) + else + KEYMAPS := $(notdir $(patsubst %/.,%,$(wildcard $(ROOT_DIR)/keyboards/$1/keymaps/*/.))) + $$(eval $$(call TRY_PARSE_KEYMAP,$$(KEYMAPS),$1)) + endif +endef + +define PARSE_ALL_KEYMAPS + COMMANDS += ALL_KEYMAPS + COMMAND_ALL_KEYMAPS := All keymaps in $1 endef +# $1 Keyboard +# $2 Keymap +define PARSE_KEYMAP + COMMANDS += KEYBOARD_$1_KEYMAP_$2 + COMMAND_KEYBOARD_$1_KEYMAP_$2 := Keyboard $1, Keymap $2 +endef # Recursively try to find a matching keyboard # During the first call $1 contains a list of all keyboards @@ -91,6 +107,18 @@ define TRY_PARSE_KEYBOARD endif endef +# $1 list of keymaps +# $2 keyboard +define TRY_PARSE_KEYMAP + CURRENT_KM := $$(firstword $1) + $$(eval $$(call COMPARE_AND_REMOVE_FROM_RULE,$$(CURRENT_KM))) + ifeq ($$(RULE_FOUND),true) + $$(eval $$(call PARSE_KEYMAP,$2,$$(CURRENT_KM))) + else ifneq ($1,) + $$(eval $$(call TRY_PARSE_KEYMAP,$$(wordlist 2,9999,$1),$2)) + endif +endef + define PARSE_RULE RULE := $1 COMMANDS := -- cgit v1.2.3 From dfe510d5b8f83c9977b507ed204632c2f22c5d24 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Thu, 4 Aug 2016 09:17:02 +0300 Subject: Refactor common rule list parsing into own function --- Makefile | 61 +++++++++++++++++++++++++++++-------------------------------- 1 file changed, 29 insertions(+), 32 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b4204478e..e88eeefee 100644 --- a/Makefile +++ b/Makefile @@ -65,6 +65,20 @@ define COMPARE_AND_REMOVE_FROM_RULE endif endef +# 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 +define TRY_TO_MATCH_RULE_FROM_LIST + $$(eval $$(call COMPARE_AND_REMOVE_FROM_RULE,$$(firstword $1))) + ifeq ($$(RULE_FOUND),true) + MATCHED_ITEM := $$(firstword $1) + else ifneq ($1,) + $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(wordlist 2,9999,$1))) + endif +endef + + define PARSE_ALL_KEYBOARDS COMMANDS += allkb #$$(info $$(RULE)) @@ -73,51 +87,31 @@ endef # $1 = Keyboard define PARSE_KEYBOARD + CURRENT_KB := $1 $$(eval $$(call COMPARE_AND_REMOVE_FROM_RULE,allkm)) ifeq ($$(RULE_FOUND),true) - $$(eval $$(call PARSE_ALL_KEYMAPS, $1)) + $$(eval $$(call PARSE_ALL_KEYMAPS)) else KEYMAPS := $(notdir $(patsubst %/.,%,$(wildcard $(ROOT_DIR)/keyboards/$1/keymaps/*/.))) - $$(eval $$(call TRY_PARSE_KEYMAP,$$(KEYMAPS),$1)) + $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYMAPS))) + ifeq ($$(RULE_FOUND),true) + $$(eval $$(call PARSE_KEYMAP,$$(MATCHED_ITEM))) + endif endif endef define PARSE_ALL_KEYMAPS COMMANDS += ALL_KEYMAPS - COMMAND_ALL_KEYMAPS := All keymaps in $1 + COMMAND_ALL_KEYMAPS := All keymaps in $(CURRENT_KB) endef -# $1 Keyboard -# $2 Keymap +# $1 Keymap define PARSE_KEYMAP - COMMANDS += KEYBOARD_$1_KEYMAP_$2 - COMMAND_KEYBOARD_$1_KEYMAP_$2 := Keyboard $1, Keymap $2 + CURRENT_KM = $1 + COMMANDS += KEYBOARD_$$(CURRENT_KB)_KEYMAP_$$(CURRENT_KM) + COMMAND_KEYBOARD_$$(CURRENT_KB)_KEYMAP_$$(CURRENT_KM) := Keyboard $$(CURRENT_KB), Keymap $$(CURRENT_KM) endef -# Recursively try to find a matching keyboard -# During the first call $1 contains a list of all keyboards -# One keyboard is checked and removed at a time -define TRY_PARSE_KEYBOARD - CURRENT_KB := $$(firstword $1) - $$(eval $$(call COMPARE_AND_REMOVE_FROM_RULE,$$(CURRENT_KB))) - ifeq ($$(RULE_FOUND),true) - $$(eval $$(call PARSE_KEYBOARD,$$(CURRENT_KB))) - else ifneq ($1,) - $$(eval $$(call TRY_PARSE_KEYBOARD,$$(wordlist 2,9999,$1))) - endif -endef - -# $1 list of keymaps -# $2 keyboard -define TRY_PARSE_KEYMAP - CURRENT_KM := $$(firstword $1) - $$(eval $$(call COMPARE_AND_REMOVE_FROM_RULE,$$(CURRENT_KM))) - ifeq ($$(RULE_FOUND),true) - $$(eval $$(call PARSE_KEYMAP,$2,$$(CURRENT_KM))) - else ifneq ($1,) - $$(eval $$(call TRY_PARSE_KEYMAP,$$(wordlist 2,9999,$1),$2)) - endif -endef define PARSE_RULE RULE := $1 @@ -126,7 +120,10 @@ define PARSE_RULE ifeq ($$(RULE_FOUND),true) $$(eval $$(call PARSE_ALL_KEYBOARDS)) else - $$(eval $$(call TRY_PARSE_KEYBOARD,$(KEYBOARDS))) + $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYBOARDS))) + ifeq ($$(RULE_FOUND),true) + $$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM))) + endif endif endef -- cgit v1.2.3 From 9ee6d4a23d9a1bdc019fc9968a909866ffeda905 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Thu, 4 Aug 2016 09:56:03 +0300 Subject: Proper looping for allkb and allkm --- Makefile | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e88eeefee..57cf3f523 100644 --- a/Makefile +++ b/Makefile @@ -78,21 +78,32 @@ define TRY_TO_MATCH_RULE_FROM_LIST endif endef +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 define PARSE_ALL_KEYBOARDS - COMMANDS += allkb - #$$(info $$(RULE)) - COMMAND_allkb := "All keyboards with $$(RULE)" + $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYBOARD,$(KEYBOARDS))) +endef + +define PARSE_ALL_KEYMAPS + $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYMAP,$$(KEYMAPS))) endef # $1 = Keyboard define PARSE_KEYBOARD CURRENT_KB := $1 + KEYMAPS := $(notdir $(patsubst %/.,%,$(wildcard $(ROOT_DIR)/keyboards/$1/keymaps/*/.))) $$(eval $$(call COMPARE_AND_REMOVE_FROM_RULE,allkm)) ifeq ($$(RULE_FOUND),true) $$(eval $$(call PARSE_ALL_KEYMAPS)) else - KEYMAPS := $(notdir $(patsubst %/.,%,$(wildcard $(ROOT_DIR)/keyboards/$1/keymaps/*/.))) $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYMAPS))) ifeq ($$(RULE_FOUND),true) $$(eval $$(call PARSE_KEYMAP,$$(MATCHED_ITEM))) @@ -100,11 +111,6 @@ define PARSE_KEYBOARD endif endef -define PARSE_ALL_KEYMAPS - COMMANDS += ALL_KEYMAPS - COMMAND_ALL_KEYMAPS := All keymaps in $(CURRENT_KB) -endef - # $1 Keymap define PARSE_KEYMAP CURRENT_KM = $1 @@ -112,7 +118,6 @@ define PARSE_KEYMAP COMMAND_KEYBOARD_$$(CURRENT_KB)_KEYMAP_$$(CURRENT_KM) := Keyboard $$(CURRENT_KB), Keymap $$(CURRENT_KM) endef - define PARSE_RULE RULE := $1 COMMANDS := -- cgit v1.2.3 From 1df6498721e989f1b3b10ba4b1b03d0ba54e9204 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 7 Aug 2016 14:33:49 +0300 Subject: Subproject parsing Does not handle keyboards without subprojects correctly yet. --- Makefile | 49 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 11 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 57cf3f523..e9e95569c 100644 --- a/Makefile +++ b/Makefile @@ -51,6 +51,7 @@ $(info Keyboards: $(KEYBOARDS)) # Otherwise the RULE_FOUND variable is set to false # The function is a bit tricky, since there's no built in $(startswith) function define COMPARE_AND_REMOVE_FROM_RULE + RULE_FOUND := false ifeq ($1,$$(RULE)) RULE:= RULE_FOUND := true @@ -70,11 +71,13 @@ endef # If a match is found, then RULE_FOUND is set to true # and MATCHED_ITEM to the item that was matched define TRY_TO_MATCH_RULE_FROM_LIST - $$(eval $$(call COMPARE_AND_REMOVE_FROM_RULE,$$(firstword $1))) - ifeq ($$(RULE_FOUND),true) - MATCHED_ITEM := $$(firstword $1) - else ifneq ($1,) - $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(wordlist 2,9999,$1))) + ifneq ($1,) + $$(eval $$(call COMPARE_AND_REMOVE_FROM_RULE,$$(firstword $1))) + ifeq ($$(RULE_FOUND),true) + MATCHED_ITEM := $$(firstword $1) + else + $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(wordlist 2,9999,$1))) + endif endif endef @@ -96,10 +99,18 @@ define PARSE_ALL_KEYMAPS $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYMAP,$$(KEYMAPS))) endef -# $1 = Keyboard -define PARSE_KEYBOARD - CURRENT_KB := $1 - KEYMAPS := $(notdir $(patsubst %/.,%,$(wildcard $(ROOT_DIR)/keyboards/$1/keymaps/*/.))) +define PARSE_ALL_SUBPROJECTS + ifeq ($$(SUBPROJECTS),) + $$(eval $$(call PARSE_SUBPROJECT,)) + else + $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_SUBPROJECT,$$(SUBPROJECTS))) + endif +endef + +# $1 Subproject +define PARSE_SUBPROJECT + CURRENT_SP := $1 + KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/keymaps/*/.))) $$(eval $$(call COMPARE_AND_REMOVE_FROM_RULE,allkm)) ifeq ($$(RULE_FOUND),true) $$(eval $$(call PARSE_ALL_KEYMAPS)) @@ -111,11 +122,27 @@ define PARSE_KEYBOARD endif endef +# $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))) + $$(eval $$(call COMPARE_AND_REMOVE_FROM_RULE,allsp)) + ifeq ($$(RULE_FOUND),true) + $$(eval $$(call PARSE_ALL_SUBPROJECTS)) + else + $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(SUBPROJECTS))) + ifeq ($$(RULE_FOUND),true) + $$(eval $$(call PARSE_SUBPROJECT,$$(MATCHED_ITEM))) + endif + endif +endef + # $1 Keymap define PARSE_KEYMAP CURRENT_KM = $1 - COMMANDS += KEYBOARD_$$(CURRENT_KB)_KEYMAP_$$(CURRENT_KM) - COMMAND_KEYBOARD_$$(CURRENT_KB)_KEYMAP_$$(CURRENT_KM) := Keyboard $$(CURRENT_KB), Keymap $$(CURRENT_KM) + COMMANDS += KEYBOARD_$$(CURRENT_KB)_SUBPROJECT_$$(CURRENT_SP)_KEYMAP_$$(CURRENT_KM) + COMMAND_KEYBOARD_$$(CURRENT_KB)_SUBPROJECT_$(CURRENT_SP)_KEYMAP_$$(CURRENT_KM) := Keyboard $$(CURRENT_KB), Subproject $$(CURRENT_SP), Keymap $$(CURRENT_KM) endef define PARSE_RULE -- cgit v1.2.3 From 286b3b8057630bf9ce78d3a0aaa24f4841b37b3e Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 7 Aug 2016 15:56:41 +0300 Subject: Slight refactoring to remove some verbosity --- Makefile | 45 ++++++++++++++++++--------------------------- 1 file changed, 18 insertions(+), 27 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e9e95569c..8f7dbb9e6 100644 --- a/Makefile +++ b/Makefile @@ -50,8 +50,7 @@ $(info Keyboards: $(KEYBOARDS)) # 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 -define COMPARE_AND_REMOVE_FROM_RULE - RULE_FOUND := false +define COMPARE_AND_REMOVE_FROM_RULE_HELPER ifeq ($1,$$(RULE)) RULE:= RULE_FOUND := true @@ -66,21 +65,25 @@ define COMPARE_AND_REMOVE_FROM_RULE endif endef +COMPARE_AND_REMOVE_FROM_RULE = $(eval $(call COMPARE_AND_REMOVE_FROM_RULE_HELPER,$1))$(RULE_FOUND) + + # 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 -define TRY_TO_MATCH_RULE_FROM_LIST +define TRY_TO_MATCH_RULE_FROM_LIST_HELPER ifneq ($1,) - $$(eval $$(call COMPARE_AND_REMOVE_FROM_RULE,$$(firstword $1))) - ifeq ($$(RULE_FOUND),true) + ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,$$(firstword $1)),true) MATCHED_ITEM := $$(firstword $1) else - $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(wordlist 2,9999,$1))) + $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER,$$(wordlist 2,9999,$1))) endif endif endef +TRY_TO_MATCH_RULE_FROM_LIST = $(eval $(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER,$1))$(RULE_FOUND) + define ALL_IN_LIST_LOOP OLD_RULE$1 := $$(RULE) $$(eval $$(call $1,$$(ITEM$1))) @@ -111,14 +114,10 @@ endef define PARSE_SUBPROJECT CURRENT_SP := $1 KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/keymaps/*/.))) - $$(eval $$(call COMPARE_AND_REMOVE_FROM_RULE,allkm)) - ifeq ($$(RULE_FOUND),true) + ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkm),true) $$(eval $$(call PARSE_ALL_KEYMAPS)) - else - $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYMAPS))) - ifeq ($$(RULE_FOUND),true) - $$(eval $$(call PARSE_KEYMAP,$$(MATCHED_ITEM))) - endif + else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYMAPS)),true) + $$(eval $$(call PARSE_KEYMAP,$$(MATCHED_ITEM))) endif endef @@ -127,14 +126,10 @@ 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))) - $$(eval $$(call COMPARE_AND_REMOVE_FROM_RULE,allsp)) - ifeq ($$(RULE_FOUND),true) + ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allsp),true) $$(eval $$(call PARSE_ALL_SUBPROJECTS)) - else - $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(SUBPROJECTS))) - ifeq ($$(RULE_FOUND),true) - $$(eval $$(call PARSE_SUBPROJECT,$$(MATCHED_ITEM))) - endif + else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(SUBPROJECTS)),true) + $$(eval $$(call PARSE_SUBPROJECT,$$(MATCHED_ITEM))) endif endef @@ -148,14 +143,10 @@ endef define PARSE_RULE RULE := $1 COMMANDS := - $$(eval $$(call COMPARE_AND_REMOVE_FROM_RULE,allkb)) - ifeq ($$(RULE_FOUND),true) + ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkb),true) $$(eval $$(call PARSE_ALL_KEYBOARDS)) - else - $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYBOARDS))) - ifeq ($$(RULE_FOUND),true) - $$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM))) - endif + else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYBOARDS)),true) + $$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM))) endif endef -- cgit v1.2.3 From 091fab5103bd896f1b36094a7337dbe2f9d2ad59 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 7 Aug 2016 16:02:14 +0300 Subject: Slight rearrange of the Makefile for easier readability --- Makefile | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 8f7dbb9e6..a03421365 100644 --- a/Makefile +++ b/Makefile @@ -94,20 +94,30 @@ define PARSE_ALL_IN_LIST $$(foreach ITEM$1,$2,$$(eval $$(call ALL_IN_LIST_LOOP,$1))) endef -define PARSE_ALL_KEYBOARDS - $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYBOARD,$(KEYBOARDS))) +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))) + endif endef -define PARSE_ALL_KEYMAPS - $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYMAP,$$(KEYMAPS))) +# $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)) + else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(SUBPROJECTS)),true) + $$(eval $$(call PARSE_SUBPROJECT,$$(MATCHED_ITEM))) + endif endef -define PARSE_ALL_SUBPROJECTS - ifeq ($$(SUBPROJECTS),) - $$(eval $$(call PARSE_SUBPROJECT,)) - else - $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_SUBPROJECT,$$(SUBPROJECTS))) - endif +define PARSE_ALL_KEYBOARDS + $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYBOARD,$(KEYBOARDS))) endef # $1 Subproject @@ -121,15 +131,11 @@ define PARSE_SUBPROJECT endif endef -# $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)) - else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(SUBPROJECTS)),true) - $$(eval $$(call PARSE_SUBPROJECT,$$(MATCHED_ITEM))) +define PARSE_ALL_SUBPROJECTS + ifeq ($$(SUBPROJECTS),) + $$(eval $$(call PARSE_SUBPROJECT,)) + else + $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_SUBPROJECT,$$(SUBPROJECTS))) endif endef @@ -140,14 +146,8 @@ define PARSE_KEYMAP COMMAND_KEYBOARD_$$(CURRENT_KB)_SUBPROJECT_$(CURRENT_SP)_KEYMAP_$$(CURRENT_KM) := Keyboard $$(CURRENT_KB), Subproject $$(CURRENT_SP), Keymap $$(CURRENT_KM) endef -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))) - endif +define PARSE_ALL_KEYMAPS + $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYMAP,$$(KEYMAPS))) endef RUN_COMMAND = echo "Running": $(COMMAND_$(COMMAND)); -- cgit v1.2.3 From 0d5caead5ad0edc06aedda06814da05815fc177e Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 7 Aug 2016 16:45:33 +0300 Subject: Add default subproject parsing --- Makefile | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a03421365..1e11dd5ff 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,8 @@ STARTING_DIR := $(subst $(ABS_ROOT_DIR),,$(ABS_STARTING_DIR)) PATH_ELEMENTS := $(subst /, ,$(STARTING_DIR)) +QUANTUM_DIR:=$(ROOT_DIR)/quantum + define NEXT_PATH_ELEMENT $$(eval CURRENT_PATH_ELEMENT := $$(firstword $$(PATH_ELEMENTS))) $$(eval PATH_ELEMENTS := $$(wordlist 2,9999,$$(PATH_ELEMENTS))) @@ -111,8 +113,14 @@ define PARSE_KEYBOARD 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)) + else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,defaultsp),true) + $$(eval $$(call PARSE_SUBPROJECT,defaultsp)) else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(SUBPROJECTS)),true) $$(eval $$(call PARSE_SUBPROJECT,$$(MATCHED_ITEM))) + 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)) endif endef @@ -122,7 +130,12 @@ endef # $1 Subproject define PARSE_SUBPROJECT - CURRENT_SP := $1 + ifeq ($1,defaultsp) + $$(eval include $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/Makefile) + CURRENT_SP := $$(SUBPROJECT_DEFAULT) + else + CURRENT_SP := $1 + endif KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/keymaps/*/.))) ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkm),true) $$(eval $$(call PARSE_ALL_KEYMAPS)) @@ -133,7 +146,7 @@ endef define PARSE_ALL_SUBPROJECTS ifeq ($$(SUBPROJECTS),) - $$(eval $$(call PARSE_SUBPROJECT,)) + $$(eval $$(call PARSE_SUBPROJECT,defaultsp)) else $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_SUBPROJECT,$$(SUBPROJECTS))) endif -- cgit v1.2.3 From 44441de8cad7255fd0637459ed39b89e34751b78 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 7 Aug 2016 17:04:39 +0300 Subject: Split keyboard makefiles into rules and Makefile --- Makefile | 2 +- keyboards/alps64/Makefile | 69 +---------------------- keyboards/alps64/rules.mk | 66 ++++++++++++++++++++++ keyboards/amj60/Makefile | 71 +----------------------- keyboards/amj60/rules.mk | 66 ++++++++++++++++++++++ keyboards/arrow_pad/Makefile | 73 +----------------------- keyboards/arrow_pad/rules.mk | 70 +++++++++++++++++++++++ keyboards/atomic/Makefile | 72 +----------------------- keyboards/atomic/rules.mk | 69 +++++++++++++++++++++++ keyboards/atreus/Makefile | 89 +---------------------------- keyboards/atreus/rules.mk | 82 +++++++++++++++++++++++++++ keyboards/bantam44/Makefile | 73 +----------------------- keyboards/bantam44/rules.mk | 67 ++++++++++++++++++++++ keyboards/chibios_test/Makefile | 11 +--- keyboards/chibios_test/rules.mk | 8 +++ keyboards/clueboard/Makefile | 108 +----------------------------------- keyboards/clueboard/rules.mk | 103 ++++++++++++++++++++++++++++++++++ keyboards/cluecard/Makefile | 77 +------------------------ keyboards/cluecard/rules.mk | 70 +++++++++++++++++++++++ keyboards/cluepad/Makefile | 71 +----------------------- keyboards/cluepad/rules.mk | 65 ++++++++++++++++++++++ keyboards/ergodox/Makefile | 33 +---------- keyboards/ergodox/rules.mk | 28 ++++++++++ keyboards/gh60/Makefile | 77 +------------------------ keyboards/gh60/rules.mk | 68 +++++++++++++++++++++++ keyboards/handwired/Makefile | 2 +- keyboards/handwired/onekey/Makefile | 66 +--------------------- keyboards/handwired/rules.mk | 0 keyboards/hhkb/Makefile | 91 +----------------------------- keyboards/hhkb/rules.mk | 84 ++++++++++++++++++++++++++++ keyboards/infinity_chibios/Makefile | 69 +---------------------- keyboards/infinity_chibios/rules.mk | 66 ++++++++++++++++++++++ keyboards/jd45/Makefile | 72 +----------------------- keyboards/jd45/rules.mk | 67 ++++++++++++++++++++++ keyboards/kc60/Makefile | 77 +------------------------ keyboards/kc60/rules.mk | 70 +++++++++++++++++++++++ keyboards/kinesis/Makefile | 80 +------------------------- keyboards/kinesis/rules.mk | 73 ++++++++++++++++++++++++ keyboards/lets_split/Makefile | 77 +------------------------ keyboards/lets_split/rules.mk | 74 ++++++++++++++++++++++++ keyboards/phantom/Makefile | 75 +------------------------ keyboards/phantom/rules.mk | 69 +++++++++++++++++++++++ keyboards/planck/Makefile | 71 +----------------------- keyboards/planck/rules.mk | 67 ++++++++++++++++++++++ keyboards/preonic/Makefile | 72 +----------------------- keyboards/preonic/rules.mk | 69 +++++++++++++++++++++++ keyboards/retro_refit/Makefile | 75 +------------------------ keyboards/retro_refit/rules.mk | 68 +++++++++++++++++++++++ keyboards/s60-x/Makefile | 76 +------------------------ keyboards/s60-x/rules.mk | 69 +++++++++++++++++++++++ keyboards/satan/Makefile | 71 +----------------------- keyboards/satan/rules.mk | 66 ++++++++++++++++++++++ keyboards/sixkeyboard/Makefile | 76 +------------------------ keyboards/sixkeyboard/rules.mk | 70 +++++++++++++++++++++++ keyboards/tv44/Makefile | 76 +------------------------ keyboards/tv44/rules.mk | 69 +++++++++++++++++++++++ 56 files changed, 1792 insertions(+), 1903 deletions(-) create mode 100644 keyboards/alps64/rules.mk create mode 100644 keyboards/amj60/rules.mk create mode 100644 keyboards/arrow_pad/rules.mk create mode 100644 keyboards/atomic/rules.mk create mode 100644 keyboards/atreus/rules.mk create mode 100644 keyboards/bantam44/rules.mk create mode 100644 keyboards/chibios_test/rules.mk create mode 100644 keyboards/clueboard/rules.mk create mode 100644 keyboards/cluecard/rules.mk create mode 100644 keyboards/cluepad/rules.mk create mode 100644 keyboards/ergodox/rules.mk create mode 100644 keyboards/gh60/rules.mk create mode 100644 keyboards/handwired/rules.mk create mode 100644 keyboards/hhkb/rules.mk create mode 100644 keyboards/infinity_chibios/rules.mk create mode 100644 keyboards/jd45/rules.mk create mode 100644 keyboards/kc60/rules.mk create mode 100644 keyboards/kinesis/rules.mk create mode 100644 keyboards/lets_split/rules.mk create mode 100644 keyboards/phantom/rules.mk create mode 100644 keyboards/planck/rules.mk create mode 100644 keyboards/preonic/rules.mk create mode 100644 keyboards/retro_refit/rules.mk create mode 100644 keyboards/s60-x/rules.mk create mode 100644 keyboards/satan/rules.mk create mode 100644 keyboards/sixkeyboard/rules.mk create mode 100644 keyboards/tv44/rules.mk (limited to 'Makefile') diff --git a/Makefile b/Makefile index 1e11dd5ff..b2a873532 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ STARTING_DIR := $(subst $(ABS_ROOT_DIR),,$(ABS_STARTING_DIR)) PATH_ELEMENTS := $(subst /, ,$(STARTING_DIR)) -QUANTUM_DIR:=$(ROOT_DIR)/quantum +MAKEFILE_INCLUDED=yes define NEXT_PATH_ELEMENT $$(eval CURRENT_PATH_ELEMENT := $$(firstword $$(PATH_ELEMENTS))) diff --git a/keyboards/alps64/Makefile b/keyboards/alps64/Makefile index d8325e6c8..4e2a6f00f 100644 --- a/keyboards/alps64/Makefile +++ b/keyboards/alps64/Makefile @@ -1,70 +1,3 @@ - - -# Target file name (without extension). - -# project specific files -SRC = led.c - -# MCU name -MCU = atmega32u2 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile endif \ No newline at end of file diff --git a/keyboards/alps64/rules.mk b/keyboards/alps64/rules.mk new file mode 100644 index 000000000..c326d3e26 --- /dev/null +++ b/keyboards/alps64/rules.mk @@ -0,0 +1,66 @@ + + +# Target file name (without extension). + +# project specific files +SRC = led.c + +# MCU name +MCU = atmega32u2 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA \ No newline at end of file diff --git a/keyboards/amj60/Makefile b/keyboards/amj60/Makefile index 1f695aa4d..4e2a6f00f 100644 --- a/keyboards/amj60/Makefile +++ b/keyboards/amj60/Makefile @@ -1,70 +1,3 @@ - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE ?= yes # Enable keyboard underlight functionality (+4870) -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150) -MIDI_ENABLE ?= no # MIDI controls -AUDIO_ENABLE ?= no -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif +endif \ No newline at end of file diff --git a/keyboards/amj60/rules.mk b/keyboards/amj60/rules.mk new file mode 100644 index 000000000..18403ac32 --- /dev/null +++ b/keyboards/amj60/rules.mk @@ -0,0 +1,66 @@ + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE ?= yes # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= no +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboards/arrow_pad/Makefile b/keyboards/arrow_pad/Makefile index 09fcf3e7a..4e2a6f00f 100644 --- a/keyboards/arrow_pad/Makefile +++ b/keyboards/arrow_pad/Makefile @@ -1,74 +1,3 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=512 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE ?= yes # USB Nkey Rollover -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile endif \ No newline at end of file diff --git a/keyboards/arrow_pad/rules.mk b/keyboards/arrow_pad/rules.mk new file mode 100644 index 000000000..3dca9b6ea --- /dev/null +++ b/keyboards/arrow_pad/rules.mk @@ -0,0 +1,70 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=512 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE ?= yes # USB Nkey Rollover +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 \ No newline at end of file diff --git a/keyboards/atomic/Makefile b/keyboards/atomic/Makefile index 08e9205cb..4e2a6f00f 100644 --- a/keyboards/atomic/Makefile +++ b/keyboards/atomic/Makefile @@ -1,73 +1,3 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -MIDI_ENABLE ?= no # MIDI controls -AUDIO_ENABLE ?= no # Audio output on port C6 -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile endif \ No newline at end of file diff --git a/keyboards/atomic/rules.mk b/keyboards/atomic/rules.mk new file mode 100644 index 000000000..d0f3a3a1c --- /dev/null +++ b/keyboards/atomic/rules.mk @@ -0,0 +1,69 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= no # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= no # Audio output on port C6 +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/atreus/Makefile b/keyboards/atreus/Makefile index 5894d231f..4e2a6f00f 100644 --- a/keyboards/atreus/Makefile +++ b/keyboards/atreus/Makefile @@ -1,88 +1,3 @@ - - -ifdef TEENSY2 - OPT_DEFS += -DATREUS_TEENSY2 - ATREUS_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex -else - OPT_DEFS += -DATREUS_ASTAR - OPT_DEFS += -DCATERINA_BOOTLOADER - ATREUS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \ - avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) -endif - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend -NKRO_ENABLE ?= yes # USB Nkey Rollover - not yet supported in LUFA -# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -# MIDI_ENABLE ?= YES # MIDI controls -UNICODE_ENABLE ?= YES # Unicode -# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID - - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif - -USB ?= /dev/cu.usbmodem1411 - -upload: build - $(ATREUS_UPLOAD_COMMAND) - +endif \ No newline at end of file diff --git a/keyboards/atreus/rules.mk b/keyboards/atreus/rules.mk new file mode 100644 index 000000000..d71f50bb2 --- /dev/null +++ b/keyboards/atreus/rules.mk @@ -0,0 +1,82 @@ + + +ifdef TEENSY2 + OPT_DEFS += -DATREUS_TEENSY2 + ATRUES_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex +else + OPT_DEFS += -DATREUS_ASTAR + OPT_DEFS += -DCATERINA_BOOTLOADER + ATRUES_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \ + avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) +endif + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend +NKRO_ENABLE ?= yes # USB Nkey Rollover - not yet supported in LUFA +# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +# MIDI_ENABLE ?= YES # MIDI controls +UNICODE_ENABLE ?= YES # Unicode +# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID + +USB ?= /dev/cu.usbmodem1411 + +upload: build + $(ATRUES_UPLOAD_COMMAND) \ No newline at end of file diff --git a/keyboards/bantam44/Makefile b/keyboards/bantam44/Makefile index 03893dbf8..4e2a6f00f 100644 --- a/keyboards/bantam44/Makefile +++ b/keyboards/bantam44/Makefile @@ -1,72 +1,3 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=512 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend -# NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -# MIDI_ENABLE ?= YES # MIDI controls -# UNICODE_ENABLE ?= YES # Unicode -# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif - +endif \ No newline at end of file diff --git a/keyboards/bantam44/rules.mk b/keyboards/bantam44/rules.mk new file mode 100644 index 000000000..baa0e9e7a --- /dev/null +++ b/keyboards/bantam44/rules.mk @@ -0,0 +1,67 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=512 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend +# NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +# MIDI_ENABLE ?= YES # MIDI controls +# UNICODE_ENABLE ?= YES # Unicode +# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboards/chibios_test/Makefile b/keyboards/chibios_test/Makefile index d9f2b8b83..4b07a6234 100644 --- a/keyboards/chibios_test/Makefile +++ b/keyboards/chibios_test/Makefile @@ -1,14 +1,5 @@ SUBPROJECT_DEFAULT = stm32_f072_onekey -#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration -MOUSEKEY_ENABLE ?= yes # Mouse keys -EXTRAKEY_ENABLE ?= yes # Audio control and System control -CONSOLE_ENABLE ?= yes # Console for debug -COMMAND_ENABLE ?= yes # Commands for debug and configuration -SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend -NKRO_ENABLE ?= yes # USB Nkey Rollover -CUSTOM_MATRIX ?= yes # Custom matrix file - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile endif \ No newline at end of file diff --git a/keyboards/chibios_test/rules.mk b/keyboards/chibios_test/rules.mk new file mode 100644 index 000000000..4b5a84535 --- /dev/null +++ b/keyboards/chibios_test/rules.mk @@ -0,0 +1,8 @@ +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +MOUSEKEY_ENABLE ?= yes # Mouse keys +EXTRAKEY_ENABLE ?= yes # Audio control and System control +CONSOLE_ENABLE ?= yes # Console for debug +COMMAND_ENABLE ?= yes # Commands for debug and configuration +SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend +NKRO_ENABLE ?= yes # USB Nkey Rollover +CUSTOM_MATRIX ?= yes # Custom matrix file \ No newline at end of file diff --git a/keyboards/clueboard/Makefile b/keyboards/clueboard/Makefile index e6b13f955..b9bada8f8 100644 --- a/keyboards/clueboard/Makefile +++ b/keyboards/clueboard/Makefile @@ -1,109 +1,5 @@ -#---------------------------------------------------------------------------- -# On command line: -# -# make all = Make software. -# -# make clean = Clean out built project files. -# -# make coff = Convert ELF to AVR COFF. -# -# make extcoff = Convert ELF to AVR Extended COFF. -# -# make program = Download the hex file to the device. -# Please customize your programmer settings(PROGRAM_CMD) -# -# make teensy = Download the hex file to the device, using teensy_loader_cli. -# (must have teensy_loader_cli installed). -# -# make dfu = Download the hex file to the device, using dfu-programmer (must -# have dfu-programmer installed). -# -# make flip = Download the hex file to the device, using Atmel FLIP (must -# have Atmel FLIP installed). -# -# make dfu-ee = Download the eeprom file to the device, using dfu-programmer -# (must have dfu-programmer installed). -# -# make flip-ee = Download the eeprom file to the device, using Atmel FLIP -# (must have Atmel FLIP installed). -# -# make debug = Start either simulavr or avarice as specified for debugging, -# with avr-gdb or avr-insight as the front end for debugging. -# -# make filename.s = Just compile filename.c into the assembler code only. -# -# make filename.i = Create a preprocessed source file for use in submitting -# bug reports to the GCC project. -# -# To rebuild project do "make clean" then "make all". -#---------------------------------------------------------------------------- - SUBPROJECT_DEFAULT = rev2 -# MCU name -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# change to no to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -AUDIO_ENABLE ?= no -RGBLIGHT_ENABLE ?= no # Enable keyboard underlight functionality -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif +endif \ No newline at end of file diff --git a/keyboards/clueboard/rules.mk b/keyboards/clueboard/rules.mk new file mode 100644 index 000000000..3909fbd5c --- /dev/null +++ b/keyboards/clueboard/rules.mk @@ -0,0 +1,103 @@ +#---------------------------------------------------------------------------- +# On command line: +# +# make all = Make software. +# +# make clean = Clean out built project files. +# +# make coff = Convert ELF to AVR COFF. +# +# make extcoff = Convert ELF to AVR Extended COFF. +# +# make program = Download the hex file to the device. +# Please customize your programmer settings(PROGRAM_CMD) +# +# make teensy = Download the hex file to the device, using teensy_loader_cli. +# (must have teensy_loader_cli installed). +# +# make dfu = Download the hex file to the device, using dfu-programmer (must +# have dfu-programmer installed). +# +# make flip = Download the hex file to the device, using Atmel FLIP (must +# have Atmel FLIP installed). +# +# make dfu-ee = Download the eeprom file to the device, using dfu-programmer +# (must have dfu-programmer installed). +# +# make flip-ee = Download the eeprom file to the device, using Atmel FLIP +# (must have Atmel FLIP installed). +# +# make debug = Start either simulavr or avarice as specified for debugging, +# with avr-gdb or avr-insight as the front end for debugging. +# +# make filename.s = Just compile filename.c into the assembler code only. +# +# make filename.i = Create a preprocessed source file for use in submitting +# bug reports to the GCC project. +# +# To rebuild project do "make clean" then "make all". +#---------------------------------------------------------------------------- + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +AUDIO_ENABLE ?= no +RGBLIGHT_ENABLE ?= no # Enable keyboard underlight functionality +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID \ No newline at end of file diff --git a/keyboards/cluecard/Makefile b/keyboards/cluecard/Makefile index 029d0b967..4e2a6f00f 100644 --- a/keyboards/cluecard/Makefile +++ b/keyboards/cluecard/Makefile @@ -1,76 +1,3 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE ?= no # USB Nkey Rollover -RGBLIGHT_ENABLE ?= yes # Enable keyboard underlight functionality (+4870) -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality by default -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= yes # Audio output on port C6 - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif - - +endif \ No newline at end of file diff --git a/keyboards/cluecard/rules.mk b/keyboards/cluecard/rules.mk new file mode 100644 index 000000000..454235877 --- /dev/null +++ b/keyboards/cluecard/rules.mk @@ -0,0 +1,70 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE ?= no # USB Nkey Rollover +RGBLIGHT_ENABLE ?= yes # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= yes # Audio output on port C6 diff --git a/keyboards/cluepad/Makefile b/keyboards/cluepad/Makefile index a331ff4dc..4e2a6f00f 100644 --- a/keyboards/cluepad/Makefile +++ b/keyboards/cluepad/Makefile @@ -1,70 +1,3 @@ - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -# MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -# EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -# CONSOLE_ENABLE ?= yes # Console for debug(+400) -# COMMAND_ENABLE ?= yes # Commands for debug and configuration -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE ?= yes # Enable numpad's backlight functionality -RGBLIGHT_ENABLE ?= yes -# MIDI_ENABLE ?= YES # MIDI controls -# UNICODE_ENABLE ?= YES # Unicode -# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID - - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif +endif \ No newline at end of file diff --git a/keyboards/cluepad/rules.mk b/keyboards/cluepad/rules.mk new file mode 100644 index 000000000..19b16b95a --- /dev/null +++ b/keyboards/cluepad/rules.mk @@ -0,0 +1,65 @@ + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +# MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +# EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +# CONSOLE_ENABLE ?= yes # Console for debug(+400) +# COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE ?= yes # Enable numpad's backlight functionality +RGBLIGHT_ENABLE ?= yes +# MIDI_ENABLE ?= YES # MIDI controls +# UNICODE_ENABLE ?= YES # Unicode +# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID \ No newline at end of file diff --git a/keyboards/ergodox/Makefile b/keyboards/ergodox/Makefile index 05fb588d1..716535005 100644 --- a/keyboards/ergodox/Makefile +++ b/keyboards/ergodox/Makefile @@ -1,34 +1,5 @@ -#---------------------------------------------------------------------------- -# On command line: -# -# make = Make software. -# -# make clean = Clean out built project files. -# -# That's pretty much all you need. To compile, always go make clean, -# followed by make. -# -# For advanced users only: -# make teensy = Download the hex file to the device, using teensy_loader_cli. -# (must have teensy_loader_cli installed). -# -#---------------------------------------------------------------------------- SUBPROJECT_DEFAULT = ez -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -CUSTOM_MATRIX ?= yes # Custom matrix file for the ErgoDox EZ -SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= yes # Unicode - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif +endif \ No newline at end of file diff --git a/keyboards/ergodox/rules.mk b/keyboards/ergodox/rules.mk new file mode 100644 index 000000000..ac63d4eff --- /dev/null +++ b/keyboards/ergodox/rules.mk @@ -0,0 +1,28 @@ +#---------------------------------------------------------------------------- +# On command line: +# +# make = Make software. +# +# make clean = Clean out built project files. +# +# That's pretty much all you need. To compile, always go make clean, +# followed by make. +# +# For advanced users only: +# make teensy = Download the hex file to the device, using teensy_loader_cli. +# (must have teensy_loader_cli installed). +# +#---------------------------------------------------------------------------- +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= no # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +CUSTOM_MATRIX ?= yes # Custom matrix file for the ErgoDox EZ +SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= yes # Unicode diff --git a/keyboards/gh60/Makefile b/keyboards/gh60/Makefile index 39a9cc0ae..4e2a6f00f 100644 --- a/keyboards/gh60/Makefile +++ b/keyboards/gh60/Makefile @@ -1,74 +1,3 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -# CONSOLE_ENABLE ?= yes # Console for debug(+400) -# COMMAND_ENABLE ?= yes # Commands for debug and configuration -KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -# MIDI_ENABLE ?= YES # MIDI controls -# UNICODE_ENABLE ?= YES # Unicode -# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID - - -ifndef QUANTUM_DIR - include ../../Makefile -endif - +ifndef MAKEFILE_INCLUDED + include ../../Makefile +endif \ No newline at end of file diff --git a/keyboards/gh60/rules.mk b/keyboards/gh60/rules.mk new file mode 100644 index 000000000..73f4bd76e --- /dev/null +++ b/keyboards/gh60/rules.mk @@ -0,0 +1,68 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +# CONSOLE_ENABLE ?= yes # Console for debug(+400) +# COMMAND_ENABLE ?= yes # Commands for debug and configuration +KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +# MIDI_ENABLE ?= YES # MIDI controls +# UNICODE_ENABLE ?= YES # Unicode +# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboards/handwired/Makefile b/keyboards/handwired/Makefile index 57493a47c..4e2a6f00f 100644 --- a/keyboards/handwired/Makefile +++ b/keyboards/handwired/Makefile @@ -1,3 +1,3 @@ -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile endif \ No newline at end of file diff --git a/keyboards/handwired/onekey/Makefile b/keyboards/handwired/onekey/Makefile index c6d10856a..4e2a6f00f 100644 --- a/keyboards/handwired/onekey/Makefile +++ b/keyboards/handwired/onekey/Makefile @@ -1,65 +1,3 @@ - - -# MCU name -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA - -ifndef QUANTUM_DIR - include ../../../Makefile +ifndef MAKEFILE_INCLUDED + include ../../Makefile endif \ No newline at end of file diff --git a/keyboards/handwired/rules.mk b/keyboards/handwired/rules.mk new file mode 100644 index 000000000..e69de29bb diff --git a/keyboards/hhkb/Makefile b/keyboards/hhkb/Makefile index 6fe973e1e..4e2a6f00f 100644 --- a/keyboards/hhkb/Makefile +++ b/keyboards/hhkb/Makefile @@ -1,90 +1,3 @@ - - -# project specific files -SRC = matrix.c - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -#OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# as per original hasu settings -OPT_DEFS += -DBOOTLOADER_SIZE=512 - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -CUSTOM_MATRIX ?= yes # Custom matrix file for the HHKB -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend -# NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -# MIDI_ENABLE ?= YES # MIDI controls -# UNICODE_ENABLE ?= YES # Unicode -# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID - - - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif - -ifneq (, $(findstring yes, $(HHKB_JP))) - OPT_DEFS += -DHHKB_JP -endif - -debug-on: EXTRAFLAGS += -DDEBUG -DDEBUG_ACTION -debug-on: all - -debug-off: EXTRAFLAGS += -DNO_DEBUG -DNO_PRINT -debug-off: OPT_DEFS := $(filter-out -DCONSOLE_ENABLE,$(OPT_DEFS)) -debug-off: all +endif \ No newline at end of file diff --git a/keyboards/hhkb/rules.mk b/keyboards/hhkb/rules.mk new file mode 100644 index 000000000..b43b5e23f --- /dev/null +++ b/keyboards/hhkb/rules.mk @@ -0,0 +1,84 @@ + + +# project specific files +SRC = matrix.c + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +#OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# as per original hasu settings +OPT_DEFS += -DBOOTLOADER_SIZE=512 + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +CUSTOM_MATRIX ?= yes # Custom matrix file for the HHKB +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend +# NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +# MIDI_ENABLE ?= YES # MIDI controls +# UNICODE_ENABLE ?= YES # Unicode +# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID + +ifneq (, $(findstring yes, $(HHKB_JP))) + OPT_DEFS += -DHHKB_JP +endif + +debug-on: EXTRAFLAGS += -DDEBUG -DDEBUG_ACTION +debug-on: all + +debug-off: EXTRAFLAGS += -DNO_DEBUG -DNO_PRINT +debug-off: OPT_DEFS := $(filter-out -DCONSOLE_ENABLE,$(OPT_DEFS)) +debug-off: all diff --git a/keyboards/infinity_chibios/Makefile b/keyboards/infinity_chibios/Makefile index 649b43e64..4e2a6f00f 100644 --- a/keyboards/infinity_chibios/Makefile +++ b/keyboards/infinity_chibios/Makefile @@ -1,70 +1,3 @@ -# project specific files -SRC = matrix.c \ - led.c - -## chip/board settings -# - the next two should match the directories in -# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) -# - For Teensies, FAMILY = KINETIS and SERIES is either -# KL2x (LC) or K20x (3.0,3.1,3.2). -# - For Infinity KB, SERIES = K20x -MCU_FAMILY = KINETIS -MCU_SERIES = K20x - -# Linker script to use -# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ -# or /ld/ -# - NOTE: a custom ld script is needed for EEPROM on Teensy LC -# - LDSCRIPT = -# - MKL26Z64 for Teensy LC -# - MK20DX128 for Teensy 3.0 -# - MK20DX256 for Teensy 3.1 and 3.2 -# - MK20DX128BLDR4 for Infinity with Kiibohd bootloader -MCU_LDSCRIPT = MK20DX128BLDR4 - -# Startup code to use -# - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ -# - STARTUP = -# - kl2x for Teensy LC -# - k20x5 for Teensy 3.0 and Infinity KB -# - k20x7 for Teensy 3.1 and 3.2 -MCU_STARTUP = k20x5 - -# Board: it should exist either in /os/hal/boards/ -# or /boards -# - BOARD = -# - PJRC_TEENSY_LC for Teensy LC -# - PJRC_TEENSY_3 for Teensy 3.0 -# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2 -# - MCHCK_K20 for Infinity KB -BOARD = MCHCK_K20 - -# Cortex version -# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 -MCU = cortex-m4 - -# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 -# I.e. 6 for Teensy LC; 7 for Teensy 3.x -ARMV = 7 - -# Vector table for application -# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ -# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB -OPT_DEFS = -DCORTEX_VTOR_INIT=0x00001000 - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration -## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) -MOUSEKEY_ENABLE ?= yes # Mouse keys -EXTRAKEY_ENABLE ?= yes # Audio control and System control -CONSOLE_ENABLE ?= yes # Console for debug -COMMAND_ENABLE ?= yes # Commands for debug and configuration -SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend -NKRO_ENABLE ?= yes # USB Nkey Rollover -CUSTOM_MATRIX ?= yes # Custom matrix file - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile endif \ No newline at end of file diff --git a/keyboards/infinity_chibios/rules.mk b/keyboards/infinity_chibios/rules.mk new file mode 100644 index 000000000..56d6470b5 --- /dev/null +++ b/keyboards/infinity_chibios/rules.mk @@ -0,0 +1,66 @@ +# project specific files +SRC = matrix.c \ + led.c + +## chip/board settings +# - the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +# - For Teensies, FAMILY = KINETIS and SERIES is either +# KL2x (LC) or K20x (3.0,3.1,3.2). +# - For Infinity KB, SERIES = K20x +MCU_FAMILY = KINETIS +MCU_SERIES = K20x + +# Linker script to use +# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +# - NOTE: a custom ld script is needed for EEPROM on Teensy LC +# - LDSCRIPT = +# - MKL26Z64 for Teensy LC +# - MK20DX128 for Teensy 3.0 +# - MK20DX256 for Teensy 3.1 and 3.2 +# - MK20DX128BLDR4 for Infinity with Kiibohd bootloader +MCU_LDSCRIPT = MK20DX128BLDR4 + +# Startup code to use +# - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +# - STARTUP = +# - kl2x for Teensy LC +# - k20x5 for Teensy 3.0 and Infinity KB +# - k20x7 for Teensy 3.1 and 3.2 +MCU_STARTUP = k20x5 + +# Board: it should exist either in /os/hal/boards/ +# or /boards +# - BOARD = +# - PJRC_TEENSY_LC for Teensy LC +# - PJRC_TEENSY_3 for Teensy 3.0 +# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2 +# - MCHCK_K20 for Infinity KB +BOARD = MCHCK_K20 + +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +# I.e. 6 for Teensy LC; 7 for Teensy 3.x +ARMV = 7 + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +OPT_DEFS = -DCORTEX_VTOR_INIT=0x00001000 + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration +## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) +MOUSEKEY_ENABLE ?= yes # Mouse keys +EXTRAKEY_ENABLE ?= yes # Audio control and System control +CONSOLE_ENABLE ?= yes # Console for debug +COMMAND_ENABLE ?= yes # Commands for debug and configuration +SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend +NKRO_ENABLE ?= yes # USB Nkey Rollover +CUSTOM_MATRIX ?= yes # Custom matrix file \ No newline at end of file diff --git a/keyboards/jd45/Makefile b/keyboards/jd45/Makefile index 75d544f16..4e2a6f00f 100644 --- a/keyboards/jd45/Makefile +++ b/keyboards/jd45/Makefile @@ -1,71 +1,3 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend -# NKRO_ENABLE ?= yes # USB Nkey Rollover - not yet supported in LUFA -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -MIDI_ENABLE ?= YES # MIDI controls -# UNICODE_ENABLE ?= YES # Unicode -BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif +endif \ No newline at end of file diff --git a/keyboards/jd45/rules.mk b/keyboards/jd45/rules.mk new file mode 100644 index 000000000..2f1e266a1 --- /dev/null +++ b/keyboards/jd45/rules.mk @@ -0,0 +1,67 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend +# NKRO_ENABLE ?= yes # USB Nkey Rollover - not yet supported in LUFA +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +MIDI_ENABLE ?= YES # MIDI controls +# UNICODE_ENABLE ?= YES # Unicode +BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID \ No newline at end of file diff --git a/keyboards/kc60/Makefile b/keyboards/kc60/Makefile index b00a488b9..4e2a6f00f 100644 --- a/keyboards/kc60/Makefile +++ b/keyboards/kc60/Makefile @@ -1,76 +1,3 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE ?= no # USB Nkey Rollover -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 - - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif - +endif \ No newline at end of file diff --git a/keyboards/kc60/rules.mk b/keyboards/kc60/rules.mk new file mode 100644 index 000000000..4efd6f988 --- /dev/null +++ b/keyboards/kc60/rules.mk @@ -0,0 +1,70 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE ?= no # USB Nkey Rollover +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 diff --git a/keyboards/kinesis/Makefile b/keyboards/kinesis/Makefile index ca077e636..4e2a6f00f 100644 --- a/keyboards/kinesis/Makefile +++ b/keyboards/kinesis/Makefile @@ -1,79 +1,3 @@ - -## Project specific files - -SRC= matrix.c - -# MCU name -MCU = at90usb1286 -#MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=1024 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= no -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE ?= no # USB Nkey Rollover -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output should be port E6, current quantum library hardcodes C6, which we use for programming -CUSTOM_MATRIX=yes # need to do our own thing with the matrix - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif - - +endif \ No newline at end of file diff --git a/keyboards/kinesis/rules.mk b/keyboards/kinesis/rules.mk new file mode 100644 index 000000000..a4a2b7d15 --- /dev/null +++ b/keyboards/kinesis/rules.mk @@ -0,0 +1,73 @@ + +## Project specific files + +SRC= matrix.c + +# MCU name +MCU = at90usb1286 +#MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=1024 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= no # Console for debug(+400) +COMMAND_ENABLE ?= no +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE ?= no # USB Nkey Rollover +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output should be port E6, current quantum library hardcodes C6, which we use for programming +CUSTOM_MATRIX=yes # need to do our own thing with the matrix diff --git a/keyboards/lets_split/Makefile b/keyboards/lets_split/Makefile index b9f07636b..4e2a6f00f 100644 --- a/keyboards/lets_split/Makefile +++ b/keyboards/lets_split/Makefile @@ -1,78 +1,3 @@ -SRC += matrix.c \ - i2c.c \ - split_util.c \ - serial.c - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality -MIDI_ENABLE ?= no # MIDI controls -AUDIO_ENABLE ?= yes # Audio output on port C6 -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend - -CUSTOM_MATRIX = yes - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile endif \ No newline at end of file diff --git a/keyboards/lets_split/rules.mk b/keyboards/lets_split/rules.mk new file mode 100644 index 000000000..6961fbd55 --- /dev/null +++ b/keyboards/lets_split/rules.mk @@ -0,0 +1,74 @@ +SRC += matrix.c \ + i2c.c \ + split_util.c \ + serial.c + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= no # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= yes # Audio output on port C6 +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend + +CUSTOM_MATRIX = yes \ No newline at end of file diff --git a/keyboards/phantom/Makefile b/keyboards/phantom/Makefile index 3a71fd0ee..4e2a6f00f 100644 --- a/keyboards/phantom/Makefile +++ b/keyboards/phantom/Makefile @@ -1,74 +1,3 @@ - - -SRC = led.c - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE ?=yes # Enable keyboard underlight functionality (+4870) -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality (+1150) -MIDI_ENABLE ?= no # MIDI controls -AUDIO_ENABLE ?= no -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID - - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif +endif \ No newline at end of file diff --git a/keyboards/phantom/rules.mk b/keyboards/phantom/rules.mk new file mode 100644 index 000000000..c6b8ca6c3 --- /dev/null +++ b/keyboards/phantom/rules.mk @@ -0,0 +1,69 @@ + + +SRC = led.c + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE ?=yes # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= no +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboards/planck/Makefile b/keyboards/planck/Makefile index 23944f92e..7d49c5ef9 100644 --- a/keyboards/planck/Makefile +++ b/keyboards/planck/Makefile @@ -1,74 +1,5 @@ - SUBPROJECT_DEFAULT = rev4 -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -MIDI_ENABLE ?= no # MIDI controls -AUDIO_ENABLE ?= no # Audio output on port C6 -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile endif \ No newline at end of file diff --git a/keyboards/planck/rules.mk b/keyboards/planck/rules.mk new file mode 100644 index 000000000..25db53a31 --- /dev/null +++ b/keyboards/planck/rules.mk @@ -0,0 +1,67 @@ +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= no # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= no # Audio output on port C6 +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/preonic/Makefile b/keyboards/preonic/Makefile index 08e9205cb..4e2a6f00f 100644 --- a/keyboards/preonic/Makefile +++ b/keyboards/preonic/Makefile @@ -1,73 +1,3 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -MIDI_ENABLE ?= no # MIDI controls -AUDIO_ENABLE ?= no # Audio output on port C6 -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile endif \ No newline at end of file diff --git a/keyboards/preonic/rules.mk b/keyboards/preonic/rules.mk new file mode 100644 index 000000000..d0f3a3a1c --- /dev/null +++ b/keyboards/preonic/rules.mk @@ -0,0 +1,69 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= no # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= no # Audio output on port C6 +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/retro_refit/Makefile b/keyboards/retro_refit/Makefile index 2dd8cc5f7..4e2a6f00f 100644 --- a/keyboards/retro_refit/Makefile +++ b/keyboards/retro_refit/Makefile @@ -1,74 +1,3 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=512 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -# MIDI_ENABLE ?= YES # MIDI controls -# UNICODE_ENABLE ?= YES # Unicode -# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID - - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif - +endif \ No newline at end of file diff --git a/keyboards/retro_refit/rules.mk b/keyboards/retro_refit/rules.mk new file mode 100644 index 000000000..10fbfa5c9 --- /dev/null +++ b/keyboards/retro_refit/rules.mk @@ -0,0 +1,68 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=512 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +# MIDI_ENABLE ?= YES # MIDI controls +# UNICODE_ENABLE ?= YES # Unicode +# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboards/s60-x/Makefile b/keyboards/s60-x/Makefile index 8b51d4609..4e2a6f00f 100644 --- a/keyboards/s60-x/Makefile +++ b/keyboards/s60-x/Makefile @@ -1,75 +1,3 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE ?= no # USB Nkey Rollover -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif - - +endif \ No newline at end of file diff --git a/keyboards/s60-x/rules.mk b/keyboards/s60-x/rules.mk new file mode 100644 index 000000000..7ec93933a --- /dev/null +++ b/keyboards/s60-x/rules.mk @@ -0,0 +1,69 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE ?= no # USB Nkey Rollover +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 \ No newline at end of file diff --git a/keyboards/satan/Makefile b/keyboards/satan/Makefile index a0879fc9c..4e2a6f00f 100644 --- a/keyboards/satan/Makefile +++ b/keyboards/satan/Makefile @@ -1,70 +1,3 @@ - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE ?= yes # Enable keyboard underlight functionality (+4870) -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150) -MIDI_ENABLE ?= no # MIDI controls -AUDIO_ENABLE ?= no -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif +endif \ No newline at end of file diff --git a/keyboards/satan/rules.mk b/keyboards/satan/rules.mk new file mode 100644 index 000000000..1102584d8 --- /dev/null +++ b/keyboards/satan/rules.mk @@ -0,0 +1,66 @@ + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE ?= yes # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= no +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboards/sixkeyboard/Makefile b/keyboards/sixkeyboard/Makefile index 6f273064a..4e2a6f00f 100644 --- a/keyboards/sixkeyboard/Makefile +++ b/keyboards/sixkeyboard/Makefile @@ -1,75 +1,3 @@ - - -SRC = matrix.c - -# MCU name -#MCU = at90usb1287 -MCU = atmega16u2 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= no # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= no # Commands for debug and configuration -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend -NKRO_ENABLE ?= no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality -MIDI_ENABLE ?= no # MIDI controls -AUDIO_ENABLE ?= no -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -CUSTOM_MATRIX = yes - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif - +endif \ No newline at end of file diff --git a/keyboards/sixkeyboard/rules.mk b/keyboards/sixkeyboard/rules.mk new file mode 100644 index 000000000..2c99985a9 --- /dev/null +++ b/keyboards/sixkeyboard/rules.mk @@ -0,0 +1,70 @@ + + +SRC = matrix.c + +# MCU name +#MCU = at90usb1287 +MCU = atmega16u2 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= no # Audio control and System control(+450) +CONSOLE_ENABLE ?= no # Console for debug(+400) +COMMAND_ENABLE ?= no # Commands for debug and configuration +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +NKRO_ENABLE ?= no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= no +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +CUSTOM_MATRIX = yes \ No newline at end of file diff --git a/keyboards/tv44/Makefile b/keyboards/tv44/Makefile index 45ca12780..4e2a6f00f 100644 --- a/keyboards/tv44/Makefile +++ b/keyboards/tv44/Makefile @@ -1,75 +1,3 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE ?= yes # USB Nkey Rollover -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif - - +endif \ No newline at end of file diff --git a/keyboards/tv44/rules.mk b/keyboards/tv44/rules.mk new file mode 100644 index 000000000..dbba6bace --- /dev/null +++ b/keyboards/tv44/rules.mk @@ -0,0 +1,69 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE ?= yes # USB Nkey Rollover +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 -- cgit v1.2.3 From 2dd9c1edcdcc3fc579e6109daf9012f9a82b7435 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 7 Aug 2016 17:48:59 +0300 Subject: Proper parsing of keymaps inside subprojects --- Makefile | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b2a873532..028d14393 100644 --- a/Makefile +++ b/Makefile @@ -131,16 +131,32 @@ endef # $1 Subproject define PARSE_SUBPROJECT ifeq ($1,defaultsp) + SUBPROJECT_DEFAULT= $$(eval include $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/Makefile) CURRENT_SP := $$(SUBPROJECT_DEFAULT) else CURRENT_SP := $1 endif - KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/keymaps/*/.))) - ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkm),true) - $$(eval $$(call PARSE_ALL_KEYMAPS)) - else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYMAPS)),true) - $$(eval $$(call PARSE_KEYMAP,$$(MATCHED_ITEM))) + # 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 + ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkm),true) + $$(eval $$(call PARSE_ALL_KEYMAPS)) + else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYMAPS)),true) + $$(eval $$(call PARSE_KEYMAP,$$(MATCHED_ITEM))) + endif + else + $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_SUBPROJECT,$(SUBPROJECTS))) endif endef -- cgit v1.2.3 From a6d35000241e20df32b34498a3a9622bde6f0062 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 7 Aug 2016 18:12:45 +0300 Subject: Print error message when trying to build non-existing keymap --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 028d14393..a9a2d98fc 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,8 @@ ifeq ($(CURRENT_PATH_ELEMENT),keyboards) endif $(info $(ROOT_DIR)/keyboards) -KEYBOARDS := $(notdir $(patsubst %/.,%,$(wildcard $(ROOT_DIR)/keyboards/*/.))) +# Only consider folders with makefiles, to prevent errors in case there are extra folders +KEYBOARDS := $(notdir $(patsubst %/Makefile,%,$(wildcard $(ROOT_DIR)/keyboards/*/Makefile))) $(info Keyboard: $(KEYBOARD)) $(info Keymap: $(KEYMAP)) @@ -154,6 +155,13 @@ define PARSE_SUBPROJECT $$(eval $$(call PARSE_ALL_KEYMAPS)) else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYMAPS)),true) $$(eval $$(call PARSE_KEYMAP,$$(MATCHED_ITEM))) + 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 endif else $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_SUBPROJECT,$(SUBPROJECTS))) -- cgit v1.2.3 From 1ad5578d11b0b4a7288c3fd0748de3a57f4180f2 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 7 Aug 2016 18:15:45 +0300 Subject: Print error when building non-existing keyboard --- Makefile | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a9a2d98fc..623e4b064 100644 --- a/Makefile +++ b/Makefile @@ -104,6 +104,9 @@ define PARSE_RULE $$(eval $$(call PARSE_ALL_KEYBOARDS)) else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYBOARDS)),true) $$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM))) + else + $$(info make: *** No rule to make target '$1'. Stop.) + exit 1 endif endef -- cgit v1.2.3 From c83af5451349e6160a2ee220e7b45bb974be5c64 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 7 Aug 2016 18:30:58 +0300 Subject: Support for running from keyboard directory --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 623e4b064..7180b4147 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ STARTING_MAKEFILE := $(firstword $(MAKEFILE_LIST)) ROOT_MAKEFILE := $(lastword $(MAKEFILE_LIST)) -ROOT_DIR := $(dir, $(ROOT_MAKEFILE)) +ROOT_DIR := $(dir $(ROOT_MAKEFILE)) ifeq ($(ROOT_DIR),) ROOT_DIR := . endif @@ -104,6 +104,8 @@ define PARSE_RULE $$(eval $$(call PARSE_ALL_KEYBOARDS)) else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYBOARDS)),true) $$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM))) + else ifneq ($$(KEYBOARD),) + $$(eval $$(call PARSE_KEYBOARD,$$(KEYBOARD))) else $$(info make: *** No rule to make target '$1'. Stop.) exit 1 -- cgit v1.2.3 From 4f20061f6619f632c28518979d17a51674a3f2c9 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 7 Aug 2016 18:44:57 +0300 Subject: Proper handling for running make from a subproject or keymap dir --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 7180b4147..a14642af6 100644 --- a/Makefile +++ b/Makefile @@ -105,6 +105,15 @@ define PARSE_RULE else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYBOARDS)),true) $$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM))) else ifneq ($$(KEYBOARD),) + # If there's no match in the beginning, then use the working directory instead + # First add the keymap to the commandline if we are in a keymap subdirectory + ifneq ($$(KEYMAP),) + RULE := $$(KEYMAP)-$$(RULE) + endif + # If we are in a subproject subdirectory add the subproject + ifneq ($$(SUBPROJECT),) + RULE := $$(SUBPROJECT)-$$(RULE) + endif $$(eval $$(call PARSE_KEYBOARD,$$(KEYBOARD))) else $$(info make: *** No rule to make target '$1'. Stop.) -- cgit v1.2.3 From 459ddaceda252a7d8614c43f17cd4c8c14712d5f Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 7 Aug 2016 18:54:12 +0300 Subject: Add backwards compability with makefile variables --- Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a14642af6..cf0a12f69 100644 --- a/Makefile +++ b/Makefile @@ -42,6 +42,20 @@ $(info $(ROOT_DIR)/keyboards) # Only consider folders with makefiles, to prevent errors in case there are extra folders KEYBOARDS := $(notdir $(patsubst %/Makefile,%,$(wildcard $(ROOT_DIR)/keyboards/*/Makefile))) +#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 + $(info Keyboard: $(KEYBOARD)) $(info Keymap: $(KEYMAP)) $(info Subproject: $(SUBPROJECT)) -- cgit v1.2.3 From 3fa6625869b1bc1a2050a7e5edc6228a926536fc Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 7 Aug 2016 19:16:44 +0300 Subject: Proper default goals when inside keyboard fodlers --- Makefile | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index cf0a12f69..38bead90a 100644 --- a/Makefile +++ b/Makefile @@ -61,6 +61,18 @@ $(info Keymap: $(KEYMAP)) $(info Subproject: $(SUBPROJECT)) $(info Keyboards: $(KEYBOARDS)) +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 + # 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 @@ -114,9 +126,11 @@ endef define PARSE_RULE RULE := $1 COMMANDS := + $$(info $$(RULE)) 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) + $$(info $$(MATCHED_ITEM)) $$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM))) else ifneq ($$(KEYBOARD),) # If there's no match in the beginning, then use the working directory instead @@ -222,12 +236,13 @@ RUN_COMMAND = echo "Running": $(COMMAND_$(COMMAND)); $(eval $(call PARSE_RULE,$@)) $(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND)) + +.PHONY: all +all: + echo "Compiling" + .PHONY: all-keyboards all-keyboards: allkb .PHONY: all-keyboards-defaults all-keyboards-defaults: allkb-default-default - -.PHONY: all -all: - echo "Compiling" \ No newline at end of file -- cgit v1.2.3 From a04bb3a3bae456a0744cf2f6dde326d9a24ebcee Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 7 Aug 2016 19:22:21 +0300 Subject: Fixed the shortcut targets --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 38bead90a..d59da0b63 100644 --- a/Makefile +++ b/Makefile @@ -61,6 +61,7 @@ $(info Keymap: $(KEYMAP)) $(info Subproject: $(SUBPROJECT)) $(info Keyboards: $(KEYBOARDS)) +.DEFAULT_GOAL := all ifneq ($(KEYMAP),) ifeq ($(SUBPROJECT),) .DEFAULT_GOAL := $(KEYBOARD)-$(KEYMAP) @@ -238,11 +239,10 @@ RUN_COMMAND = echo "Running": $(COMMAND_$(COMMAND)); .PHONY: all -all: - echo "Compiling" +all: all-keyboards .PHONY: all-keyboards -all-keyboards: allkb +all-keyboards: allkb-allsp-allkm .PHONY: all-keyboards-defaults -all-keyboards-defaults: allkb-default-default +all-keyboards-defaults: allkb-allsp-default -- cgit v1.2.3 From 0dd629a990e1546614dfa2b430489571c2550f7a Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 7 Aug 2016 21:28:14 +0300 Subject: Fix running make from various subfolders --- Makefile | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d59da0b63..a02fa24a2 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,6 @@ ifeq ($(CURRENT_PATH_ELEMENT),keyboards) endif endif -$(info $(ROOT_DIR)/keyboards) # Only consider folders with makefiles, to prevent errors in case there are extra folders KEYBOARDS := $(notdir $(patsubst %/Makefile,%,$(wildcard $(ROOT_DIR)/keyboards/*/Makefile))) @@ -127,22 +126,11 @@ endef define PARSE_RULE RULE := $1 COMMANDS := - $$(info $$(RULE)) 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) - $$(info $$(MATCHED_ITEM)) $$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM))) else ifneq ($$(KEYBOARD),) - # If there's no match in the beginning, then use the working directory instead - # First add the keymap to the commandline if we are in a keymap subdirectory - ifneq ($$(KEYMAP),) - RULE := $$(KEYMAP)-$$(RULE) - endif - # If we are in a subproject subdirectory add the subproject - ifneq ($$(SUBPROJECT),) - RULE := $$(SUBPROJECT)-$$(RULE) - endif $$(eval $$(call PARSE_KEYBOARD,$$(KEYBOARD))) else $$(info make: *** No rule to make target '$1'. Stop.) @@ -161,6 +149,8 @@ define PARSE_KEYBOARD $$(eval $$(call PARSE_SUBPROJECT,defaultsp)) else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(SUBPROJECTS)),true) $$(eval $$(call PARSE_SUBPROJECT,$$(MATCHED_ITEM))) + else ifneq ($$(SUBPROJECT),) + $$(eval $$(call PARSE_SUBPROJECT,$$(SUBPROJECT))) 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 @@ -194,10 +184,14 @@ define PARSE_SUBPROJECT SP_KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/$$(CURRENT_SP)/keymaps/*/.))) KEYMAPS := $$(sort $$(KEYMAPS) $$(SP_KEYMAPS)) endif - ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkm),true) + ifeq ($$(RULE),) + $$(eval $$(call PARSE_ALL_KEYMAPS)) + else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkm),true) $$(eval $$(call PARSE_ALL_KEYMAPS)) else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYMAPS)),true) $$(eval $$(call PARSE_KEYMAP,$$(MATCHED_ITEM))) + else ifneq ($$(KEYMAP),) + $$(eval $$(call PARSE_KEYMAP,$$(KEYMAP))) else ifeq ($$(CURRENT_SP),) $$(info make: *** No rule to make target '$$(CURRENT_KB)-$$(RULE)'. Stop.) @@ -232,12 +226,16 @@ endef RUN_COMMAND = echo "Running": $(COMMAND_$(COMMAND)); +# Allow specifying just the subproject, in the keyboard directory, which will compile all keymaps +SUBPROJECTS := $(notdir $(patsubst %/Makefile,%,$(wildcard ./*/Makefile))) +.PHONY: $(SUBPROJECTS) +$(SUBPROJECTS): %: %-allkm + .PHONY: % %: $(eval $(call PARSE_RULE,$@)) $(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND)) - .PHONY: all all: all-keyboards -- cgit v1.2.3 From db5c3b74fb6541879bfad9930d2a659b1d89cd83 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Mon, 8 Aug 2016 01:16:06 +0300 Subject: Add color output --- Makefile | 33 ++++++++++++++++++++++++++++++--- message.mk | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 message.mk (limited to 'Makefile') diff --git a/Makefile b/Makefile index a02fa24a2..e5becd7ad 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,7 @@ +ifndef VERBOSE +.SILENT: +endif + STARTING_MAKEFILE := $(firstword $(MAKEFILE_LIST)) ROOT_MAKEFILE := $(lastword $(MAKEFILE_LIST)) ROOT_DIR := $(dir $(ROOT_MAKEFILE)) @@ -216,15 +220,37 @@ endef # $1 Keymap define PARSE_KEYMAP CURRENT_KM = $1 - COMMANDS += KEYBOARD_$$(CURRENT_KB)_SUBPROJECT_$$(CURRENT_SP)_KEYMAP_$$(CURRENT_KM) - COMMAND_KEYBOARD_$$(CURRENT_KB)_SUBPROJECT_$(CURRENT_SP)_KEYMAP_$$(CURRENT_KM) := Keyboard $$(CURRENT_KB), Subproject $$(CURRENT_SP), Keymap $$(CURRENT_KM) + 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) + COMMAND_$$(COMMAND) := \ + printf "Compiling $$(KB_SP) with $(BOLD)$$(CURRENT_KM)$(NO_COLOR)" | \ + $(AWK) '{ printf "%-118s", $$$$0;}'; \ + LOG=$$$$(echo "$$(MAKE) -c $(ROOT_DIR) -f build_keyboard.mk VERBOSE=$(VERBOSE) COLOR=$(COLOR) SILENT=true" 2>&1) ; \ + if [ $$$$? -gt 0 ]; \ + then $$(PRINT_ERROR_PLAIN); \ + elif [ "$$$$LOG" != "" ] ; \ + then $$(PRINT_WARNING_PLAIN); \ + else \ + $$(PRINT_OK); \ + fi; endef define PARSE_ALL_KEYMAPS $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYMAP,$$(KEYMAPS))) endef -RUN_COMMAND = echo "Running": $(COMMAND_$(COMMAND)); +include $(ROOT_DIR)/message.mk + +#RUN_COMMAND = echo "Running": $(COMMAND_$(COMMAND)); +RUN_COMMAND = \ +$(COMMAND_$(COMMAND)) +#LOG=$$(echo $(COMMAND) VERBOSE=$(VERBOSE) COLOR=$(COLOR) SILENT=true 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR_PLAIN); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING_PLAIN); else $(PRINT_OK); fi; \ # Allow specifying just the subproject, in the keyboard directory, which will compile all keymaps SUBPROJECTS := $(notdir $(patsubst %/Makefile,%,$(wildcard ./*/Makefile))) @@ -244,3 +270,4 @@ all-keyboards: allkb-allsp-allkm .PHONY: all-keyboards-defaults all-keyboards-defaults: allkb-allsp-default + diff --git a/message.mk b/message.mk new file mode 100644 index 000000000..2ebf76a58 --- /dev/null +++ b/message.mk @@ -0,0 +1,35 @@ +COLOR ?= true + +ifeq ($(COLOR),true) + NO_COLOR=\033[0m + OK_COLOR=\033[32;01m + ERROR_COLOR=\033[31;01m + WARN_COLOR=\033[33;01m + BLUE=\033[0;34m + BOLD=\033[1m +endif + +ifneq ($(shell awk --version 2>/dev/null),) + AWK=awk +else + AWK=cat && test +endif + +OK_STRING=$(OK_COLOR)[OK]$(NO_COLOR)\n +ERROR_STRING=$(ERROR_COLOR)[ERRORS]$(NO_COLOR)\n +WARN_STRING=$(WARN_COLOR)[WARNINGS]$(NO_COLOR)\n + +ifndef $(SILENT) + SILENT = false +endif + +TAB_LOG = printf "\n$$LOG\n\n" | $(AWK) '{ sub(/^/," | "); print }' +TAB_LOG_PLAIN = printf "$$LOG\n" +AWK_STATUS = $(AWK) '{ printf " %-10s\n", $$1; }' +AWK_CMD = $(AWK) '{ printf "%-99s", $$0; }' +PRINT_ERROR = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG) && exit 1 +PRINT_WARNING = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG) +PRINT_ERROR_PLAIN = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN) && exit 1 +PRINT_WARNING_PLAIN = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN) +PRINT_OK = $(SILENT) || printf " $(OK_STRING)" | $(AWK_STATUS) +BUILD_CMD = LOG=$$($(CMD) 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING); else $(PRINT_OK); fi; \ No newline at end of file -- cgit v1.2.3 From 67b294ca66fd9da341ab93019a380d91ac589c96 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Mon, 8 Aug 2016 10:26:23 +0300 Subject: Actual compilation --- Makefile | 26 +++++---- build_keyboard.mk | 171 ++++++++++++++---------------------------------------- message.mk | 3 +- 3 files changed, 59 insertions(+), 141 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e5becd7ad..fc6157209 100644 --- a/Makefile +++ b/Makefile @@ -228,17 +228,19 @@ define PARSE_KEYMAP KB_SP := $(CURRENT_KB)/$$(CURRENT_SP) endif KB_SP := $(BOLD)$$(KB_SP)$(NO_COLOR) + MAKE_VARS := KEYBOARD=$$(CURRENT_KB) SUBPROJECT=$$(CURRENT_SP) KEYMAP=$$(CURRENT_KM) + MAKE_VARS += VERBOSE=$(VERBOSE) COLOR=$(COLOR) SILENT=false COMMAND_$$(COMMAND) := \ - printf "Compiling $$(KB_SP) with $(BOLD)$$(CURRENT_KM)$(NO_COLOR)" | \ - $(AWK) '{ printf "%-118s", $$$$0;}'; \ - LOG=$$$$(echo "$$(MAKE) -c $(ROOT_DIR) -f build_keyboard.mk VERBOSE=$(VERBOSE) COLOR=$(COLOR) SILENT=true" 2>&1) ; \ - if [ $$$$? -gt 0 ]; \ - then $$(PRINT_ERROR_PLAIN); \ - elif [ "$$$$LOG" != "" ] ; \ - then $$(PRINT_WARNING_PLAIN); \ - else \ - $$(PRINT_OK); \ - fi; + printf "Compiling $$(KB_SP) with $(BOLD)$$(CURRENT_KM)$(NO_COLOR)" | \ + $(AWK) '{ printf "%-118s", $$$$0;}'; \ + LOG=$$$$($$(MAKE) -C $(ROOT_DIR) -f build_keyboard.mk $$(MAKE_VARS) 2>&1) ; \ + if [ $$$$? -gt 0 ]; \ + then $$(PRINT_ERROR_PLAIN); \ + elif [ "$$$$LOG" != "" ] ; \ + then $$(PRINT_WARNING_PLAIN); \ + else \ + $$(PRINT_OK); \ + fi; endef define PARSE_ALL_KEYMAPS @@ -258,9 +260,11 @@ SUBPROJECTS := $(notdir $(patsubst %/Makefile,%,$(wildcard ./*/Makefile))) $(SUBPROJECTS): %: %-allkm .PHONY: % -%: +%: + cmp --version >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi; $(eval $(call PARSE_RULE,$@)) $(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND)) + .PHONY: all all: all-keyboards diff --git a/build_keyboard.mk b/build_keyboard.mk index 053c8532a..b0cb22e6a 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -4,44 +4,9 @@ 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) +TOP_DIR = . TMK_DIR = tmk_core TMK_PATH = $(TOP_DIR)/$(TMK_DIR) LIB_PATH = $(TOP_DIR)/lib @@ -50,92 +15,49 @@ QUANTUM_DIR = quantum QUANTUM_PATH = $(TOP_DIR)/$(QUANTUM_DIR) -ifdef keyboard - KEYBOARD ?= $(keyboard) -endif -ifdef KEYBOARD_DIR - KEYBOARD ?= $(KEYBOARD_DIR) -endif -ifndef KEYBOARD - KEYBOARD=planck -endif - MASTER ?= left ifdef master MASTER = $(master) endif +KEYBOARD_PATH := keyboards/$(KEYBOARD) +KEYBOARD_C := $(KEYBOARD_PATH)/$(KEYBOARD).c -# converts things to keyboards/subproject -ifneq (,$(findstring /,$(KEYBOARD))) - TEMP:=$(KEYBOARD) - KEYBOARD:=$(firstword $(subst /, ,$(TEMP))) - SUBPROJECT:=$(lastword $(subst /, ,$(TEMP))) -endif - -KEYBOARD_PATH = $(TOP_DIR)/keyboards/$(KEYBOARD) - -ifdef sub - SUBPROJECT=$(sub) -endif -ifdef subproject - SUBPROJECT=$(subproject) -endif - -ifneq ("$(wildcard $(KEYBOARD_PATH)/$(KEYBOARD).c)","") - KEYBOARD_FILE = keyboards/$(KEYBOARD)/$(KEYBOARD).c - ifneq ($(call ESCAPED_ABS_PATH,$(KEYBOARD_PATH)/Makefile),$(starting_makefile)) - -include $(KEYBOARD_PATH)/Makefile - endif +ifneq ("$(wildcard $(KEYBOARD_C))","") + include $(KEYBOARD_PATH)/rules.mk else -$(error "$(KEYBOARD_PATH)/$(KEYBOARD).c" does not exist) -endif - -ifdef SUBPROJECT_DEFAULT - SUBPROJECT?=$(SUBPROJECT_DEFAULT) -endif - -ifdef SUBPROJECT - SUBPROJECT_PATH = $(TOP_DIR)/keyboards/$(KEYBOARD)/$(SUBPROJECT) - ifneq ("$(wildcard $(SUBPROJECT_PATH)/$(SUBPROJECT).c)","") - OPT_DEFS += -DSUBPROJECT_$(SUBPROJECT) - SUBPROJECT_FILE = keyboards/$(KEYBOARD)/$(SUBPROJECT)/$(SUBPROJECT).c - 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 -endif - -ifdef keymap - KEYMAP ?= $(keymap) -endif -ifdef KEYMAP_DIR - KEYMAP ?= $(KEYMAP_DIR) -endif -ifndef KEYMAP - KEYMAP = default -endif -KEYMAP_PATH = $(KEYBOARD_PATH)/keymaps/$(KEYMAP) -ifneq ("$(wildcard $(KEYMAP_PATH)/keymap.c)","") - KEYMAP_FILE = keyboards/$(KEYBOARD)/keymaps/$(KEYMAP)/keymap.c - 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 - ifneq ($(call ESCAPED_ABS_PATH,$(KEYMAP_PATH)/Makefile),$(starting_makefile)) - -include $(KEYMAP_PATH)/Makefile - endif - endif + $(error "$(KEYBOARD_C)" does not exist) +endif + + +ifneq ($(SUBPROJECT),) + SUBPROJECT_PATH := keyboards/$(KEYBOARD)/$(SUBPROJECT) + SUBPROJECT_C := $(SUBPROJECT_PATH)/$(SUBPROJECT).c + ifneq ("$(wildcard $(SUBPROJECT_C))","") + OPT_DEFS += -DSUBPROJECT_$(SUBPROJECT) + include $(SUBPROJECT_PATH)/rules.mk + else + $(error "$(SUBPROJECT_PATH)/$(SUBPROJECT).c" does not exist) + endif +endif + +MAIN_KEYMAP_PATH := $(KEYBOARD_PATH)/keymaps/$(KEYMAP) +MAIN_KEYMAP_C := $(MAIN_KEYMAP_PATH)/keymap.c +SUBPROJ_KEYMAP_PATH := $(SUBPROJECT_PATH)/keymaps/$(KEYMAP) +SUBPROJ_KEYMAP_C := $(SUBPROJ_KEYMAP_PATH)/keymap.c +ifneq ("$(wildcard $(SUBPROJ_KEYMAP_C))","") + -include $(SUBPROJ_KEYMAP_PATH)/Makefile + KEYMAP_C := $(SUBPROJ_KEYMAP_C) + KEYMAP_PATH := $(SUBPROJ_KEYMAP_PATH) +else ifneq ("$(wildcard $(MAIN_KEYMAP_C))","") + -include $(MAIN_KEYMAP_PATH)/Makefile + KEYMAP_C := $(MAIN_KEYMAP_C) + KEYMAP_PATH := $(MAIN_KEYMAP_PATH) +else + $(error "$(MAIN_KEYMAP_C)/keymap.c" does not exist) endif -ifdef SUBPROJECT +ifneq ($(SUBPROJECT),) TARGET ?= $(KEYBOARD)_$(SUBPROJECT)_$(KEYMAP) else TARGET ?= $(KEYBOARD)_$(KEYMAP) @@ -149,36 +71,27 @@ BUILD_DIR = $(TOP_DIR)/.build OBJDIR = $(BUILD_DIR)/obj_$(TARGET) - ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","") CONFIG_H = $(KEYMAP_PATH)/config.h else CONFIG_H = $(KEYBOARD_PATH)/config.h - ifdef SUBPROJECT - ifneq ("$(wildcard $(SUBPROJECT_PATH)/$(SUBPROJECT).c)","") + ifneq ($(SUBPROJECT),) + ifneq ("$(wildcard $(SUBPROJECT_C))","") CONFIG_H = $(SUBPROJECT_PATH)/config.h endif endif endif # # project specific files -SRC += $(KEYBOARD_FILE) \ - $(KEYMAP_FILE) \ +SRC += $(KEYBOARD_C) \ + $(KEYMAP_C) \ $(QUANTUM_DIR)/quantum.c \ $(QUANTUM_DIR)/keymap_common.c \ $(QUANTUM_DIR)/keycode_config.c \ $(QUANTUM_DIR)/process_keycode/process_leader.c -ifdef SUBPROJECT - SRC += $(SUBPROJECT_FILE) -endif - -ifdef SUBPROJECT - SRC += $(SUBPROJECT_FILE) -endif - -ifdef SUBPROJECT - SRC += $(SUBPROJECT_FILE) +ifneq ($(SUBPROJECT),) + SRC += $(SUBPROJECT_C) endif ifndef CUSTOM_MATRIX @@ -229,7 +142,7 @@ endif # Search Path VPATH += $(KEYMAP_PATH) -ifdef SUBPROJECT +ifneq ($(SUBPROJECT),) VPATH += $(SUBPROJECT_PATH) endif VPATH += $(KEYBOARD_PATH) diff --git a/message.mk b/message.mk index 2ebf76a58..08a4e02ab 100644 --- a/message.mk +++ b/message.mk @@ -32,4 +32,5 @@ PRINT_WARNING = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB PRINT_ERROR_PLAIN = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN) && exit 1 PRINT_WARNING_PLAIN = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN) PRINT_OK = $(SILENT) || printf " $(OK_STRING)" | $(AWK_STATUS) -BUILD_CMD = LOG=$$($(CMD) 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING); else $(PRINT_OK); fi; \ No newline at end of file +BUILD_CMD = LOG=$$($(CMD) 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING); else $(PRINT_OK); fi; +MSG_NO_CMP = $(ERROR_COLOR)Error:$(NO_COLOR)$(BOLD) cmp command not found, please install diffutils\n$(NO_COLOR) \ No newline at end of file -- cgit v1.2.3 From 60c6e79ecb032e9726809a295ab3e0011e6b2fb4 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Mon, 8 Aug 2016 11:19:29 +0300 Subject: Move git submodule check and version generation to main Makefile --- Makefile | 12 ++++++++++++ build_keyboard.mk | 5 ----- tmk_core/rules.mk | 13 ++----------- 3 files changed, 14 insertions(+), 16 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index fc6157209..caa8f2de1 100644 --- a/Makefile +++ b/Makefile @@ -262,6 +262,13 @@ $(SUBPROJECTS): %: %-allkm .PHONY: % %: cmp --version >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi; + git submodule status --recursive 2>/dev/null | \ + while IFS= read -r x; do \ + case "$$x" in \ + \ *) ;; \ + *) printf "$(MSG_SUBMODULE_DIRTY)";break;; \ + esac \ + done $(eval $(call PARSE_RULE,$@)) $(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND)) @@ -275,3 +282,8 @@ all-keyboards: allkb-allsp-allkm .PHONY: all-keyboards-defaults all-keyboards-defaults: allkb-allsp-default + +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) \ No newline at end of file diff --git a/build_keyboard.mk b/build_keyboard.mk index 7493c1328..7d284cfa7 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -183,9 +183,4 @@ endif 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)\" - -$(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/tmk_core/rules.mk b/tmk_core/rules.mk index 9aa4ac8cf..e8e3de571 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -267,15 +267,6 @@ sym: $(BUILD_DIR)/$(TARGET).sym LIBNAME=lib$(TARGET).a lib: $(LIBNAME) -check_submodule: - git submodule status --recursive | \ - while IFS= read -r x; do \ - case "$$x" in \ - \ *) ;; \ - *) printf "$(MSG_SUBMODULE_DIRTY)";break;; \ - esac \ - done - # Display size of file. HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex #ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf @@ -337,7 +328,7 @@ gccversion : $(eval CMD=$(AR) $@ $(OBJ) ) @$(BUILD_CMD) -BEGIN = gccversion check_submodule sizebefore +BEGIN = gccversion sizebefore # Link: create ELF output file from object files. .SECONDARY : $(BUILD_DIR)/$(TARGET).elf @@ -443,6 +434,6 @@ $(shell mkdir $(KBOBJDIR) 2>/dev/null) # Listing of phony targets. .PHONY : all finish sizebefore sizeafter gccversion \ -build elf hex eep lss sym coff extcoff check_submodule \ +build elf hex eep lss sym coff extcoff \ clean clean_list debug gdb-config show_path \ program teensy dfu flip dfu-ee flip-ee dfu-start \ No newline at end of file -- cgit v1.2.3 From 881bde8258e077500a99fd670633e79ecd074832 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Tue, 9 Aug 2016 08:30:21 +0300 Subject: Fix running make in parallel --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index caa8f2de1..b39e9dded 100644 --- a/Makefile +++ b/Makefile @@ -270,7 +270,7 @@ $(SUBPROJECTS): %: %-allkm esac \ done $(eval $(call PARSE_RULE,$@)) - $(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND)) + +$(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND)) .PHONY: all -- cgit v1.2.3 From e4c842de02d95e98f65c7bb4a8406ec6df4944fe Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Tue, 9 Aug 2016 08:31:04 +0300 Subject: Don't run builtin rules for submake To speed up the compilation --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b39e9dded..9b534e897 100644 --- a/Makefile +++ b/Makefile @@ -233,7 +233,7 @@ define PARSE_KEYMAP COMMAND_$$(COMMAND) := \ printf "Compiling $$(KB_SP) with $(BOLD)$$(CURRENT_KM)$(NO_COLOR)" | \ $(AWK) '{ printf "%-118s", $$$$0;}'; \ - LOG=$$$$($$(MAKE) -C $(ROOT_DIR) -f build_keyboard.mk $$(MAKE_VARS) 2>&1) ; \ + LOG=$$$$($$(MAKE) -r -R -C $(ROOT_DIR) -f build_keyboard.mk $$(MAKE_VARS) 2>&1) ; \ if [ $$$$? -gt 0 ]; \ then $$(PRINT_ERROR_PLAIN); \ elif [ "$$$$LOG" != "" ] ; \ -- cgit v1.2.3 From 8732265928818dd0b8797fb271e7c7fa9346d025 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Tue, 9 Aug 2016 09:52:01 +0300 Subject: Options for silent compilation A single keyboard is always by default compiled in verbose mode. While multiple keyboards are compiled in silent mode. This can be overriden by the silent variable from the command line --- Makefile | 50 ++++++++++++++++++++++++++++++++++++++------------ message.mk | 4 ---- 2 files changed, 38 insertions(+), 16 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 9b534e897..3d4bd589f 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,16 @@ ifndef VERBOSE .SILENT: endif +ifdef silent + SILENT = $(silent) +endif + +ifdef SILENT + SUB_IS_SILENT := $(silent) +endif + +override SILENT = false + STARTING_MAKEFILE := $(firstword $(MAKEFILE_LIST)) ROOT_MAKEFILE := $(lastword $(MAKEFILE_LIST)) ROOT_DIR := $(dir $(ROOT_MAKEFILE)) @@ -59,10 +69,10 @@ ifdef keymap KEYMAP := $(keymap) endif -$(info Keyboard: $(KEYBOARD)) -$(info Keymap: $(KEYMAP)) -$(info Subproject: $(SUBPROJECT)) -$(info Keyboards: $(KEYBOARDS)) +#$(info Keyboard: $(KEYBOARD)) +#$(info Keymap: $(KEYMAP)) +#$(info Subproject: $(SUBPROJECT)) +#$(info Keyboards: $(KEYBOARDS)) .DEFAULT_GOAL := all ifneq ($(KEYMAP),) @@ -229,11 +239,14 @@ define PARSE_KEYMAP endif KB_SP := $(BOLD)$$(KB_SP)$(NO_COLOR) MAKE_VARS := KEYBOARD=$$(CURRENT_KB) SUBPROJECT=$$(CURRENT_SP) KEYMAP=$$(CURRENT_KM) - MAKE_VARS += VERBOSE=$(VERBOSE) COLOR=$(COLOR) SILENT=false - COMMAND_$$(COMMAND) := \ - printf "Compiling $$(KB_SP) with $(BOLD)$$(CURRENT_KM)$(NO_COLOR)" | \ - $(AWK) '{ printf "%-118s", $$$$0;}'; \ - LOG=$$$$($$(MAKE) -r -R -C $(ROOT_DIR) -f build_keyboard.mk $$(MAKE_VARS) 2>&1) ; \ + MAKE_VARS += VERBOSE=$(VERBOSE) COLOR=$(COLOR) + MAKE_COMMAND := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_keyboard.mk + MAKE_MSG := Compiling $$(KB_SP) with $(BOLD)$$(CURRENT_KM)$(NO_COLOR) + MAKE_MSG_FORMAT := $(AWK) '{ printf "%-118s", $$$$0;}' + COMMAND_true_$$(COMMAND) := \ + printf "$$(MAKE_MSG)" | \ + $$(MAKE_MSG_FORMAT); \ + LOG=$$$$($$(MAKE_COMMAND) $$(MAKE_VARS) SILENT=true 2>&1) ; \ if [ $$$$? -gt 0 ]; \ then $$(PRINT_ERROR_PLAIN); \ elif [ "$$$$LOG" != "" ] ; \ @@ -241,18 +254,30 @@ define PARSE_KEYMAP else \ $$(PRINT_OK); \ fi; + COMMAND_false_$$(COMMAND) := \ + printf "$$(MAKE_MSG)\n" | \ + $$(MAKE_MSG_FORMAT); \ + $$(MAKE_COMMAND) $$(MAKE_VARS) SILENT=false; endef define PARSE_ALL_KEYMAPS $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYMAP,$$(KEYMAPS))) endef +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 + include $(ROOT_DIR)/message.mk -#RUN_COMMAND = echo "Running": $(COMMAND_$(COMMAND)); RUN_COMMAND = \ -$(COMMAND_$(COMMAND)) -#LOG=$$(echo $(COMMAND) VERBOSE=$(VERBOSE) COLOR=$(COLOR) SILENT=true 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR_PLAIN); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING_PLAIN); else $(PRINT_OK); fi; \ +$(COMMAND_$(SILENT_MODE)_$(COMMAND)) # Allow specifying just the subproject, in the keyboard directory, which will compile all keymaps SUBPROJECTS := $(notdir $(patsubst %/Makefile,%,$(wildcard ./*/Makefile))) @@ -270,6 +295,7 @@ $(SUBPROJECTS): %: %-allkm esac \ done $(eval $(call PARSE_RULE,$@)) + $(eval $(call SET_SILENT_MODE)) +$(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND)) diff --git a/message.mk b/message.mk index 08a4e02ab..aefb46de8 100644 --- a/message.mk +++ b/message.mk @@ -19,10 +19,6 @@ OK_STRING=$(OK_COLOR)[OK]$(NO_COLOR)\n ERROR_STRING=$(ERROR_COLOR)[ERRORS]$(NO_COLOR)\n WARN_STRING=$(WARN_COLOR)[WARNINGS]$(NO_COLOR)\n -ifndef $(SILENT) - SILENT = false -endif - TAB_LOG = printf "\n$$LOG\n\n" | $(AWK) '{ sub(/^/," | "); print }' TAB_LOG_PLAIN = printf "$$LOG\n" AWK_STATUS = $(AWK) '{ printf " %-10s\n", $$1; }' -- cgit v1.2.3 From d924eb591ebcfb603f8941763de9616ce4b1554c Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Thu, 11 Aug 2016 09:34:23 +0300 Subject: Fix variable name clash with builtin This caused the submake to be called several times, messing up the build. --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3d4bd589f..319684c83 100644 --- a/Makefile +++ b/Makefile @@ -240,13 +240,13 @@ define PARSE_KEYMAP KB_SP := $(BOLD)$$(KB_SP)$(NO_COLOR) MAKE_VARS := KEYBOARD=$$(CURRENT_KB) SUBPROJECT=$$(CURRENT_SP) KEYMAP=$$(CURRENT_KM) MAKE_VARS += VERBOSE=$(VERBOSE) COLOR=$(COLOR) - MAKE_COMMAND := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_keyboard.mk + MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_keyboard.mk MAKE_MSG := Compiling $$(KB_SP) with $(BOLD)$$(CURRENT_KM)$(NO_COLOR) MAKE_MSG_FORMAT := $(AWK) '{ printf "%-118s", $$$$0;}' COMMAND_true_$$(COMMAND) := \ printf "$$(MAKE_MSG)" | \ $$(MAKE_MSG_FORMAT); \ - LOG=$$$$($$(MAKE_COMMAND) $$(MAKE_VARS) SILENT=true 2>&1) ; \ + LOG=$$$$($$(MAKE_CMD) $$(MAKE_VARS) SILENT=true 2>&1) ; \ if [ $$$$? -gt 0 ]; \ then $$(PRINT_ERROR_PLAIN); \ elif [ "$$$$LOG" != "" ] ; \ @@ -257,7 +257,7 @@ define PARSE_KEYMAP COMMAND_false_$$(COMMAND) := \ printf "$$(MAKE_MSG)\n" | \ $$(MAKE_MSG_FORMAT); \ - $$(MAKE_COMMAND) $$(MAKE_VARS) SILENT=false; + $$(MAKE_CMD) $$(MAKE_VARS) SILENT=false; endef define PARSE_ALL_KEYMAPS -- cgit v1.2.3 From 87bf34a5d341c3a2381f57c19fcb94c21c8d0122 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 14 Aug 2016 12:25:23 +0300 Subject: Pass the target to submake --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 319684c83..ed89b0733 100644 --- a/Makefile +++ b/Makefile @@ -230,6 +230,9 @@ endef # $1 Keymap define PARSE_KEYMAP CURRENT_KM = $1 + # The rest of the rule is the target + # Remove the leading "-" from the target, as it acts as a separator + MAKE_TARGET := $$(patsubst -%,%,$$(RULE)) COMMAND := COMMAND_KEYBOARD_$$(CURRENT_KB)_SUBPROJECT_$(CURRENT_SP)_KEYMAP_$$(CURRENT_KM) COMMANDS += $$(COMMAND) ifeq ($$(CURRENT_SP),) @@ -240,8 +243,11 @@ define PARSE_KEYMAP KB_SP := $(BOLD)$$(KB_SP)$(NO_COLOR) MAKE_VARS := KEYBOARD=$$(CURRENT_KB) SUBPROJECT=$$(CURRENT_SP) KEYMAP=$$(CURRENT_KM) MAKE_VARS += VERBOSE=$(VERBOSE) COLOR=$(COLOR) - MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_keyboard.mk - MAKE_MSG := Compiling $$(KB_SP) with $(BOLD)$$(CURRENT_KM)$(NO_COLOR) + 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 MAKE_MSG_FORMAT := $(AWK) '{ printf "%-118s", $$$$0;}' COMMAND_true_$$(COMMAND) := \ printf "$$(MAKE_MSG)" | \ -- cgit v1.2.3 From 03e31ef8b9752220d092a1950030cf7942e002eb Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Tue, 16 Aug 2016 08:42:08 +0300 Subject: Continue on error --- Makefile | 6 +++++- message.mk | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ed89b0733..f80d4e99c 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,8 @@ endif override SILENT = false +ON_ERROR := error_occured=1 + STARTING_MAKEFILE := $(firstword $(MAKEFILE_LIST)) ROOT_MAKEFILE := $(lastword $(MAKEFILE_LIST)) ROOT_DIR := $(dir $(ROOT_MAKEFILE)) @@ -302,7 +304,9 @@ $(SUBPROJECTS): %: %-allkm done $(eval $(call PARSE_RULE,$@)) $(eval $(call SET_SILENT_MODE)) - +$(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND)) + +error_occured=0; \ + $(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND)) \ + if [ $$error_occured -gt 0 ]; then printf "$(MSG_ERRORS)" & exit $$error_occured; fi .PHONY: all diff --git a/message.mk b/message.mk index 6abc78215..f8fd38712 100644 --- a/message.mk +++ b/message.mk @@ -15,6 +15,8 @@ else AWK=cat && test endif +ON_ERROR ?= exit 1 + OK_STRING=$(OK_COLOR)[OK]$(NO_COLOR)\n ERROR_STRING=$(ERROR_COLOR)[ERRORS]$(NO_COLOR)\n WARN_STRING=$(WARN_COLOR)[WARNINGS]$(NO_COLOR)\n @@ -23,9 +25,9 @@ TAB_LOG = printf "\n$$LOG\n\n" | $(AWK) '{ sub(/^/," | "); print }' TAB_LOG_PLAIN = printf "$$LOG\n" AWK_STATUS = $(AWK) '{ printf " %-10s\n", $$1; }' AWK_CMD = $(AWK) '{ printf "%-99s", $$0; }' -PRINT_ERROR = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG) && exit 1 +PRINT_ERROR = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG) && $(ON_ERROR) PRINT_WARNING = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG) -PRINT_ERROR_PLAIN = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN) && exit 1 +PRINT_ERROR_PLAIN = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN) && $(ON_ERROR) PRINT_WARNING_PLAIN = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN) PRINT_OK = $(SILENT) || printf " $(OK_STRING)" | $(AWK_STATUS) BUILD_CMD = LOG=$$($(CMD) 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING); else $(PRINT_OK); fi; @@ -34,6 +36,7 @@ MSG_NO_CMP = $(ERROR_COLOR)Error:$(NO_COLOR)$(BOLD) cmp command not found, pleas # Define Messages # English MSG_ERRORS_NONE = Errors: none +MSG_ERRORS = $(ERROR_COLOR)Make finished with errors\n$(NO_COLOR) MSG_BEGIN = -------- begin -------- MSG_END = -------- end -------- MSG_SIZE_BEFORE = Size before: -- cgit v1.2.3 From f29730da36cb2e036c5878327f567532d2533ff1 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Tue, 16 Aug 2016 08:57:10 +0300 Subject: Better format for non-silent output --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f80d4e99c..9ca73b4ad 100644 --- a/Makefile +++ b/Makefile @@ -263,8 +263,7 @@ define PARSE_KEYMAP $$(PRINT_OK); \ fi; COMMAND_false_$$(COMMAND) := \ - printf "$$(MAKE_MSG)\n" | \ - $$(MAKE_MSG_FORMAT); \ + printf "$$(MAKE_MSG)\n\n"; \ $$(MAKE_CMD) $$(MAKE_VARS) SILENT=false; endef -- cgit v1.2.3 From b26ded3ab1c09e2a127feb5f4e22e97242ce77d7 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 20 Aug 2016 14:53:29 +0300 Subject: Comment the Makefile Also move some messages to message.mk --- Makefile | 129 +++++++++++++++++++++++++++++++++++++++++++++++++++++-------- message.mk | 13 ++++++- 2 files changed, 124 insertions(+), 18 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 9ca73b4ad..d70ac9a3b 100644 --- a/Makefile +++ b/Makefile @@ -2,15 +2,18 @@ ifndef VERBOSE .SILENT: endif +# 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) + SUB_IS_SILENT := $(SILENT) endif -override SILENT = false +# 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 @@ -26,27 +29,44 @@ 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)) - 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 SUBPROJECT := $(CURRENT_PATH_ELEMENT) $(eval $(call NEXT_PATH_ELEMENT)) + # if we are inside a keymap folder of a subproject ifeq ($(CURRENT_PATH_ELEMENT),keymaps) $(eval $(call NEXT_PATH_ELEMENT)) KEYMAP := $(CURRENT_PATH_ELEMENT) @@ -57,7 +77,8 @@ endif # Only consider folders with makefiles, to prevent errors in case there are extra folders KEYBOARDS := $(notdir $(patsubst %/Makefile,%,$(wildcard $(ROOT_DIR)/keyboards/*/Makefile))) -#Compability with the old make variables +#Compability with the old make variables, anything you specify directly on the command line +# always overrides the detected folders ifdef keyboard KEYBOARD := $(keyboard) endif @@ -71,29 +92,41 @@ ifdef keymap KEYMAP := $(keymap) endif +# Uncomment these for debugging #$(info Keyboard: $(KEYBOARD)) #$(info Keymap: $(KEYMAP)) #$(info Subproject: $(SUBPROJECT)) #$(info Keyboards: $(KEYBOARDS)) + +# Set the default goal depening on where we are running make from +# this handles the case where you run make without any arguments .DEFAULT_GOAL := all ifneq ($(KEYMAP),) ifeq ($(SUBPROJECT),) + # Inside a keymap folder, just build the keymap, with the + # default subproject .DEFAULT_GOAL := $(KEYBOARD)-$(KEYMAP) else + # Inside a subproject keyamp folder, build the keymap + # for that subproject .DEFAULT_GOAL := $(KEYBOARD)-$(SUBPROJECT)-$(KEYMAP) endif else ifneq ($(SUBPROJECT),) + # Inside a subproject folder, build all keymaps for that subproject .DEFAULT_GOAL := $(KEYBOARD)-$(SUBPROJECT)-allkm else ifneq ($(KEYBOARD),) + # Inside a keyboard folder, build all keymaps for all subprojects + # Note that this is different from the old behaviour, which would + # build only the default keymap of the default keyboard .DEFAULT_GOAL := $(KEYBOARD)-allsp-allkm endif -# Compare the start of the RULE_VARIABLE with the first argument($1) +# 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 +# Otherwise the RULE_FOUND variable is set to false, and RULE left as it was # The function is a bit tricky, since there's no built in $(startswith) function define COMPARE_AND_REMOVE_FROM_RULE_HELPER ifeq ($1,$$(RULE)) @@ -110,10 +143,12 @@ define COMPARE_AND_REMOVE_FROM_RULE_HELPER endif endef +# This makes it easier to call COMPARE_AND_REMOVE_FROM_RULE, since it makes it behave like +# a function that returns the value COMPARE_AND_REMOVE_FROM_RULE = $(eval $(call COMPARE_AND_REMOVE_FROM_RULE_HELPER,$1))$(RULE_FOUND) -# Recursively try to find a match +# Recursively try to find a match for the start of the rule to be checked # $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 @@ -127,6 +162,7 @@ define TRY_TO_MATCH_RULE_FROM_LIST_HELPER endif endef +# Make it easier to call TRY_TO_MATCH_RULE_FROM_LIST TRY_TO_MATCH_RULE_FROM_LIST = $(eval $(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER,$1))$(RULE_FOUND) define ALL_IN_LIST_LOOP @@ -139,47 +175,70 @@ define PARSE_ALL_IN_LIST $$(foreach ITEM$1,$2,$$(eval $$(call ALL_IN_LIST_LOOP,$1))) endef +# The entry point for rule parsing +# parses a rule in the format --- +# but this particular function only deals with the first part define PARSE_RULE RULE := $1 COMMANDS := + # If the rule starts with allkb, then continue the parsing from + # PARSE_ALL_KEYBOARDS ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkb),true) $$(eval $$(call PARSE_ALL_KEYBOARDS)) + # If the rule starts with the name of a known keyboard, then continue + # the parsing from PARSE_KEYBOARD else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYBOARDS)),true) $$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM))) + # Otherwise use the KEYBOARD variable, which is determined either by + # the current directory you run make from, or passed in as an argument else ifneq ($$(KEYBOARD),) $$(eval $$(call PARSE_KEYBOARD,$$(KEYBOARD))) else $$(info make: *** No rule to make target '$1'. Stop.) + # Notice the tab instead of spaces below! exit 1 endif endef # $1 = Keyboard +# Parses a rule in the format -- +# the keyboard is already known when entering this function 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))) + # if the rule starts with allsp, then continue with looping over all subprojects ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allsp),true) $$(eval $$(call PARSE_ALL_SUBPROJECTS)) + # A special case for matching the defaultsp (default subproject) else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,defaultsp),true) $$(eval $$(call PARSE_SUBPROJECT,defaultsp)) + # If the rule starts with the name of a known subproject else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(SUBPROJECTS)),true) $$(eval $$(call PARSE_SUBPROJECT,$$(MATCHED_ITEM))) + # Try to use the SUBPROJECT variable, which is either determined by the + # directory which invoked make, or passed as an argument to make else ifneq ($$(SUBPROJECT),) $$(eval $$(call PARSE_SUBPROJECT,$$(SUBPROJECT))) + # 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 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)) endif endef +# if we are going to compile all keyboards, match the rest of the rule +# for each of them define PARSE_ALL_KEYBOARDS $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYBOARD,$(KEYBOARDS))) endef # $1 Subproject +# When entering this, the keyboard and subproject are known, so now we need +# to determine which keymaps are going to get compiled define PARSE_SUBPROJECT + # If we want to compile the default subproject, then we need to + # include the correct makefile to determine the actual name of it ifeq ($1,defaultsp) SUBPROJECT_DEFAULT= $$(eval include $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/Makefile) @@ -188,39 +247,54 @@ define PARSE_SUBPROJECT CURRENT_SP := $1 endif # If current subproject is empty (the default was not defined), and we have a list of subproject - # then make all + # then make all of them ifeq ($$(CURRENT_SP),) ifneq ($$(SUBPROJECTS),) CURRENT_SP := allsp endif endif + # The special allsp is handled later ifneq ($$(CURRENT_SP),allsp) + # get a list of all keymaps KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/keymaps/*/.))) ifneq ($$(CURRENT_SP),) + # if the subproject is defined, then also look for keymaps inside the subproject folder SP_KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/$$(CURRENT_SP)/keymaps/*/.))) KEYMAPS := $$(sort $$(KEYMAPS) $$(SP_KEYMAPS)) endif + # if the rule after removing the start of it is empty (we haven't specified a kemap or target) + # compile all the keymaps ifeq ($$(RULE),) $$(eval $$(call PARSE_ALL_KEYMAPS)) + # The same if allkm was specified else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkm),true) $$(eval $$(call PARSE_ALL_KEYMAPS)) + # Try to match the specified keyamp with the list of known keymaps else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYMAPS)),true) $$(eval $$(call PARSE_KEYMAP,$$(MATCHED_ITEM))) + # Otherwise try to match the keymap from the current folder, or arguments to the make command else ifneq ($$(KEYMAP),) $$(eval $$(call PARSE_KEYMAP,$$(KEYMAP))) else + # Otherwise something is wrong with the target + # Try to give as much information as possible of what it it was trying to do 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 + # Notice the tab instead of spaces below! exit 1 endif else + # As earlier mentione,d when allsb is specified, we call our self recursively + # for all of the subprojects $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_SUBPROJECT,$(SUBPROJECTS))) endif endef +# If we want to parse all subprojects, but the keyboard doesn't have any, +# then use defaultsp instead define PARSE_ALL_SUBPROJECTS ifeq ($$(SUBPROJECTS),) $$(eval $$(call PARSE_SUBPROJECT,defaultsp)) @@ -230,27 +304,36 @@ define PARSE_ALL_SUBPROJECTS endef # $1 Keymap +# This is the meat of compiling a keyboard, when entering this, everything is known +# keyboard, subproject, and keymap +# Note that we are not directly calling the command here, but instead building a list, +# which will later be processed define PARSE_KEYMAP CURRENT_KM = $1 # The rest of the rule is the target # Remove the leading "-" from the target, as it acts as a separator MAKE_TARGET := $$(patsubst -%,%,$$(RULE)) + # We need to generate an unique indentifer to append to the COMMANDS list COMMAND := COMMAND_KEYBOARD_$$(CURRENT_KB)_SUBPROJECT_$(CURRENT_SP)_KEYMAP_$$(CURRENT_KM) COMMANDS += $$(COMMAND) + # If we are compiling a keyboard without a subproject, we want to display just the name + # of the keyboard, otherwise keyboard/subproject ifeq ($$(CURRENT_SP),) KB_SP := $(CURRENT_KB) else KB_SP := $(CURRENT_KB)/$$(CURRENT_SP) endif + # Format it in bold KB_SP := $(BOLD)$$(KB_SP)$(NO_COLOR) + # Specify the variables that we are passing forward to submake MAKE_VARS := KEYBOARD=$$(CURRENT_KB) SUBPROJECT=$$(CURRENT_SP) KEYMAP=$$(CURRENT_KM) MAKE_VARS += VERBOSE=$(VERBOSE) COLOR=$(COLOR) + # And the first part of the make command 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 - MAKE_MSG_FORMAT := $(AWK) '{ printf "%-118s", $$$$0;}' + # The message to display + MAKE_MSG := $$(MSG_MAKE_KB) + # We run the command differently, depending on if we want more output or not + # The true version for silent output and the false version otherwise COMMAND_true_$$(COMMAND) := \ printf "$$(MAKE_MSG)" | \ $$(MAKE_MSG_FORMAT); \ @@ -267,10 +350,14 @@ define PARSE_KEYMAP $$(MAKE_CMD) $$(MAKE_VARS) SILENT=false; endef +# Just parse all the keymaps for a specifc keyboard define PARSE_ALL_KEYMAPS $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYMAP,$$(KEYMAPS))) endef +# Set the silent mode depending on if we are trying to compile multiple keyboards or not +# By default it's on in that case, but it can be overriden by specifying silent=false +# from the command line define SET_SILENT_MODE ifdef SUB_IS_SILENT SILENT_MODE := $(SUB_IS_SILENT) @@ -291,9 +378,12 @@ SUBPROJECTS := $(notdir $(patsubst %/Makefile,%,$(wildcard ./*/Makefile))) .PHONY: $(SUBPROJECTS) $(SUBPROJECTS): %: %-allkm +# Let's match everything, we handle all the rule parsing ourselves .PHONY: % %: + # Check if we have the CMP tool installed cmp --version >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi; + # Check if the submodules are dirty, and display a warning if they are git submodule status --recursive 2>/dev/null | \ while IFS= read -r x; do \ case "$$x" in \ @@ -303,14 +393,20 @@ $(SUBPROJECTS): %: %-allkm done $(eval $(call PARSE_RULE,$@)) $(eval $(call SET_SILENT_MODE)) + # Run all the commands in the same shell, notice the + at the first line + # it has to be there to allow parallel execution of the submake + # This always tries to compile everything, even if error occurs in the middle + # But we return the error code at the end, to trigger travis failures +error_occured=0; \ $(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND)) \ if [ $$error_occured -gt 0 ]; then printf "$(MSG_ERRORS)" & exit $$error_occured; fi +# All should compile everything .PHONY: all all: all-keyboards +# Define some shortcuts, mostly for compability with the old syntax .PHONY: all-keyboards all-keyboards: allkb-allsp-allkm @@ -318,6 +414,7 @@ all-keyboards: allkb-allsp-allkm all-keyboards-defaults: allkb-allsp-default +# Generate the version.h file 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) diff --git a/message.mk b/message.mk index f8fd38712..fb1a7a1f9 100644 --- a/message.mk +++ b/message.mk @@ -31,7 +31,7 @@ PRINT_ERROR_PLAIN = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $ PRINT_WARNING_PLAIN = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN) PRINT_OK = $(SILENT) || printf " $(OK_STRING)" | $(AWK_STATUS) BUILD_CMD = LOG=$$($(CMD) 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING); else $(PRINT_OK); fi; -MSG_NO_CMP = $(ERROR_COLOR)Error:$(NO_COLOR)$(BOLD) cmp command not found, please install diffutils\n$(NO_COLOR) +MAKE_MSG_FORMAT = $(AWK) '{ printf "%-118s", $$0;}' # Define Messages # English @@ -59,4 +59,13 @@ MSG_SUBMODULE_DIRTY = $(WARN_COLOR)WARNING:$(NO_COLOR)\n \ git submodule sync --recursive\n\ git submodule update --init --recursive$(NO_COLOR)\n\n\ You can ignore this warning if you are not compiling any ChibiOS keyboards,\n\ - or if you have modified the ChibiOS libraries yourself. \n\n \ No newline at end of file + or if you have modified the ChibiOS libraries yourself. \n\n +MSG_NO_CMP = $(ERROR_COLOR)Error:$(NO_COLOR)$(BOLD) cmp command not found, please install diffutils\n$(NO_COLOR) + +define GENERATE_MSG_MAKE_KB + MSG_MAKE_KB_ACTUAL := Making $$(KB_SP) with keymap $(BOLD)$$(CURRENT_KM)$(NO_COLOR) + ifneq ($$(MAKE_TARGET),) + MSG_MAKE_KB_ACTUAL += and target $(BOLD)$$(MAKE_TARGET)$(NO_COLOR) + endif +endef +MSG_MAKE_KB = $(eval $(call GENERATE_MSG_MAKE_KB))$(MSG_MAKE_KB_ACTUAL) -- cgit v1.2.3 From 1c69acb7d518893ee77e326342d4603da87470e5 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 21 Aug 2016 13:10:34 +0300 Subject: Add longest match to the rule-checking This fixes cases where you have several keyboards with a common prefix, like algernon, and algernon-master --- Makefile | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d70ac9a3b..c8122e576 100644 --- a/Makefile +++ b/Makefile @@ -152,13 +152,52 @@ COMPARE_AND_REMOVE_FROM_RULE = $(eval $(call COMPARE_AND_REMOVE_FROM_RULE_HELPER # $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 -define TRY_TO_MATCH_RULE_FROM_LIST_HELPER +define TRY_TO_MATCH_RULE_FROM_LIST_HELPER3 ifneq ($1,) ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,$$(firstword $1)),true) MATCHED_ITEM := $$(firstword $1) else - $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER,$$(wordlist 2,9999,$1))) + $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER3,$$(wordlist 2,9999,$1))) + endif + endif +endef + +# A recursive helper function for finding the longest match +# $1 The list to be checed +# It works by always removing the currently matched item from the list +# and call itself recursively, until a match is found +define TRY_TO_MATCH_RULE_FROM_LIST_HELPER2 + # Stop the recursion when the list is empty + ifneq ($1,) + RULE_BEFORE := $$(RULE) + $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER3,$1)) + # If a match is found in the current list, otherwise just return what we had before + ifeq ($$(RULE_FOUND),true) + # Save the best match so far and call itself recursivel + BEST_MATCH := $$(MATCHED_ITEM) + BEST_MATCH_RULE := $$(RULE) + RULE_FOUND := false + RULE := $$(RULE_BEFORE) + $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER2,$$(filter-out $$(MATCHED_ITEM),$1))) endif + endif +endef + + +# Recursively try to find the longest match for the start of the rule to be checked +# $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 +define TRY_TO_MATCH_RULE_FROM_LIST_HELPER + BEST_MATCH := + $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER2,$1)) + ifneq ($$(BEST_MATCH),) + RULE_FOUND := true + RULE := $$(BEST_MATCH_RULE) + MATCHED_ITEM := $$(BEST_MATCH) + else + RULE_FOUND := false + MATCHED_ITEM := endif endef -- cgit v1.2.3 From 7c9fff59d0bfd36016a5cd79d40ec27ae591610b Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Wed, 24 Aug 2016 10:29:01 +0300 Subject: Fix slight inconsistency When running make from either a keyboard folder or a subproject it runs all keymaps for all subprojects and the selected subproject respectively. Without this fix, the same doesn't happen if your run make clean for example. As it would just provide you with an error message. Now this will work as expected. --- Makefile | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c8122e576..f78cca6c6 100644 --- a/Makefile +++ b/Makefile @@ -262,7 +262,7 @@ define PARSE_KEYBOARD # 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 else - $$(eval $$(call PARSE_SUBPROJECT,defaultsp)) + $$(eval $$(call PARSE_SUBPROJECT,)) endif endef @@ -278,12 +278,14 @@ endef define PARSE_SUBPROJECT # If we want to compile the default subproject, then we need to # include the correct makefile to determine the actual name of it - ifeq ($1,defaultsp) + CURRENT_SP := $1 + ifeq ($$(CURRENT_SP),) + CURRENT_SP := defaultsp + endif + ifeq ($$(CURRENT_SP),defaultsp) SUBPROJECT_DEFAULT= $$(eval include $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/Makefile) CURRENT_SP := $$(SUBPROJECT_DEFAULT) - else - CURRENT_SP := $1 endif # If current subproject is empty (the default was not defined), and we have a list of subproject # then make all of them @@ -314,16 +316,16 @@ define PARSE_SUBPROJECT # Otherwise try to match the keymap from the current folder, or arguments to the make command else ifneq ($$(KEYMAP),) $$(eval $$(call PARSE_KEYMAP,$$(KEYMAP))) + # No matching keymap found, so we assume that the rest of the rule is the target + # If we haven't been able to parse out a subproject, then make all of them + # This is consistent with running make without any arguments from the keyboard + # folder + else ifeq ($1,) + $$(eval $$(call PARSE_ALL_SUBPROJECTS)) + # Otherwise, make all keymaps, again this is consistent with how it works without + # any arguments else - # Otherwise something is wrong with the target - # Try to give as much information as possible of what it it was trying to do - 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 - # Notice the tab instead of spaces below! - exit 1 + $$(eval $$(call PARSE_ALL_KEYMAPS)) endif else # As earlier mentione,d when allsb is specified, we call our self recursively -- cgit v1.2.3