summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Sundvik <fsundvik@gmail.com>2017-06-16 21:34:01 +0300
committerFred Sundvik <fsundvik@gmail.com>2017-06-18 21:10:42 +0300
commit7424261dae180d1cc0e4e46b4ee2d51ef5524e0a (patch)
treec2180efd00452bfca7dfd9754a66d17d5efdd751
parent30f22d450da19c65584e6deb8515a1fa5b074e07 (diff)
Try to build tmk_common
-rw-r--r--build_full_test.mk10
-rw-r--r--build_keyboard.mk122
-rw-r--r--common.mk124
3 files changed, 132 insertions, 124 deletions
diff --git a/build_full_test.mk b/build_full_test.mk
index 0405b9d0f8..5b4685a91a 100644
--- a/build_full_test.mk
+++ b/build_full_test.mk
@@ -11,4 +11,12 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>. \ No newline at end of file
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+include tests/$(TEST)/rules.mk
+#include $(TMK_PATH)/protocol.mk
+
+TEST_PATH=tests/$(TEST)
+
+$(TEST)_SRC=$(TEST_PATH)/test.c $(TMK_COMMON_SRC)
+$(TEST)_DEFS=$(TMK_COMMON_DEFS)
diff --git a/build_keyboard.mk b/build_keyboard.mk
index 36eab3a9e5..f13d5b6d69 100644
--- a/build_keyboard.mk
+++ b/build_keyboard.mk
@@ -131,128 +131,6 @@ ifndef CUSTOM_MATRIX
SRC += $(QUANTUM_DIR)/matrix.c
endif
-ifeq ($(strip $(API_SYSEX_ENABLE)), yes)
- OPT_DEFS += -DAPI_SYSEX_ENABLE
- SRC += $(QUANTUM_DIR)/api/api_sysex.c
- OPT_DEFS += -DAPI_ENABLE
- SRC += $(QUANTUM_DIR)/api.c
- MIDI_ENABLE=yes
-endif
-
-MUSIC_ENABLE := 0
-
-ifeq ($(strip $(AUDIO_ENABLE)), yes)
- OPT_DEFS += -DAUDIO_ENABLE
- MUSIC_ENABLE := 1
- SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c
- SRC += $(QUANTUM_DIR)/audio/audio.c
- SRC += $(QUANTUM_DIR)/audio/voices.c
- SRC += $(QUANTUM_DIR)/audio/luts.c
-endif
-
-ifeq ($(strip $(MIDI_ENABLE)), yes)
- OPT_DEFS += -DMIDI_ENABLE
- MUSIC_ENABLE := 1
- SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c
-endif
-
-ifeq ($(MUSIC_ENABLE), 1)
- SRC += $(QUANTUM_DIR)/process_keycode/process_music.c
-endif
-
-ifeq ($(strip $(COMBO_ENABLE)), yes)
- OPT_DEFS += -DCOMBO_ENABLE
- SRC += $(QUANTUM_DIR)/process_keycode/process_combo.c
-endif
-
-ifeq ($(strip $(VIRTSER_ENABLE)), yes)
- OPT_DEFS += -DVIRTSER_ENABLE
-endif
-
-ifeq ($(strip $(FAUXCLICKY_ENABLE)), yes)
- OPT_DEFS += -DFAUXCLICKY_ENABLE
- SRC += $(QUANTUM_DIR)/fauxclicky.c
-endif
-
-ifeq ($(strip $(UCIS_ENABLE)), yes)
- OPT_DEFS += -DUCIS_ENABLE
- UNICODE_COMMON = yes
- SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c
-endif
-
-ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
- OPT_DEFS += -DUNICODEMAP_ENABLE
- UNICODE_COMMON = yes
- SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c
-endif
-
-ifeq ($(strip $(UNICODE_ENABLE)), yes)
- OPT_DEFS += -DUNICODE_ENABLE
- UNICODE_COMMON = yes
- SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
-endif
-
-ifeq ($(strip $(UNICODE_COMMON)), yes)
- SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
-endif
-
-ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
- OPT_DEFS += -DRGBLIGHT_ENABLE
- SRC += $(QUANTUM_DIR)/light_ws2812.c
- SRC += $(QUANTUM_DIR)/rgblight.c
- CIE1931_CURVE = yes
- LED_BREATHING_TABLE = yes
-endif
-
-ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
- OPT_DEFS += -DTAP_DANCE_ENABLE
- SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
-endif
-
-ifeq ($(strip $(PRINTING_ENABLE)), yes)
- OPT_DEFS += -DPRINTING_ENABLE
- SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c
- SRC += $(TMK_DIR)/protocol/serial_uart.c
-endif
-
-ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
- SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
- OPT_DEFS += $(SERIAL_DEFS)
- VAPTH += $(SERIAL_PATH)
-endif
-
-ifneq ($(strip $(VARIABLE_TRACE)),)
- SRC += $(QUANTUM_DIR)/variable_trace.c
- OPT_DEFS += -DNUM_TRACED_VARIABLES=$(strip $(VARIABLE_TRACE))
-ifneq ($(strip $(MAX_VARIABLE_TRACE_SIZE)),)
- OPT_DEFS += -DMAX_VARIABLE_TRACE_SIZE=$(strip $(MAX_VARIABLE_TRACE_SIZE))
-endif
-endif
-
-ifeq ($(strip $(LCD_ENABLE)), yes)
- CIE1931_CURVE = yes
-endif
-
-ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
- ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
- CIE1931_CURVE = yes
- endif
-endif
-
-ifeq ($(strip $(CIE1931_CURVE)), yes)
- OPT_DEFS += -DUSE_CIE1931_CURVE
- LED_TABLES = yes
-endif
-
-ifeq ($(strip $(LED_BREATHING_TABLE)), yes)
- OPT_DEFS += -DUSE_LED_BREATHING_TABLE
- LED_TABLES = yes
-endif
-
-ifeq ($(strip $(LED_TABLES)), yes)
- SRC += $(QUANTUM_DIR)/led_tables.c
-endif
-
# Optimize size but this may cause error "relocation truncated to fit"
#EXTRALDFLAGS = -Wl,--relax
diff --git a/common.mk b/common.mk
index c4b9394a24..51e4283ba7 100644
--- a/common.mk
+++ b/common.mk
@@ -24,4 +24,126 @@ COMMON_VPATH += $(QUANTUM_PATH)/keymap_extras
COMMON_VPATH += $(QUANTUM_PATH)/audio
COMMON_VPATH += $(QUANTUM_PATH)/process_keycode
COMMON_VPATH += $(QUANTUM_PATH)/api
-COMMON_VPATH += $(SERIAL_PATH) \ No newline at end of file
+COMMON_VPATH += $(SERIAL_PATH)
+
+ifeq ($(strip $(API_SYSEX_ENABLE)), yes)
+ OPT_DEFS += -DAPI_SYSEX_ENABLE
+ SRC += $(QUANTUM_DIR)/api/api_sysex.c
+ OPT_DEFS += -DAPI_ENABLE
+ SRC += $(QUANTUM_DIR)/api.c
+ MIDI_ENABLE=yes
+endif
+
+MUSIC_ENABLE := 0
+
+ifeq ($(strip $(AUDIO_ENABLE)), yes)
+ OPT_DEFS += -DAUDIO_ENABLE
+ MUSIC_ENABLE := 1
+ SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c
+ SRC += $(QUANTUM_DIR)/audio/audio.c
+ SRC += $(QUANTUM_DIR)/audio/voices.c
+ SRC += $(QUANTUM_DIR)/audio/luts.c
+endif
+
+ifeq ($(strip $(MIDI_ENABLE)), yes)
+ OPT_DEFS += -DMIDI_ENABLE
+ MUSIC_ENABLE := 1
+ SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c
+endif
+
+ifeq ($(MUSIC_ENABLE), 1)
+ SRC += $(QUANTUM_DIR)/process_keycode/process_music.c
+endif
+
+ifeq ($(strip $(COMBO_ENABLE)), yes)
+ OPT_DEFS += -DCOMBO_ENABLE
+ SRC += $(QUANTUM_DIR)/process_keycode/process_combo.c
+endif
+
+ifeq ($(strip $(VIRTSER_ENABLE)), yes)
+ OPT_DEFS += -DVIRTSER_ENABLE
+endif
+
+ifeq ($(strip $(FAUXCLICKY_ENABLE)), yes)
+ OPT_DEFS += -DFAUXCLICKY_ENABLE
+ SRC += $(QUANTUM_DIR)/fauxclicky.c
+endif
+
+ifeq ($(strip $(UCIS_ENABLE)), yes)
+ OPT_DEFS += -DUCIS_ENABLE
+ UNICODE_COMMON = yes
+ SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c
+endif
+
+ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
+ OPT_DEFS += -DUNICODEMAP_ENABLE
+ UNICODE_COMMON = yes
+ SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c
+endif
+
+ifeq ($(strip $(UNICODE_ENABLE)), yes)
+ OPT_DEFS += -DUNICODE_ENABLE
+ UNICODE_COMMON = yes
+ SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
+endif
+
+ifeq ($(strip $(UNICODE_COMMON)), yes)
+ SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
+endif
+
+ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
+ OPT_DEFS += -DRGBLIGHT_ENABLE
+ SRC += $(QUANTUM_DIR)/light_ws2812.c
+ SRC += $(QUANTUM_DIR)/rgblight.c
+ CIE1931_CURVE = yes
+ LED_BREATHING_TABLE = yes
+endif
+
+ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
+ OPT_DEFS += -DTAP_DANCE_ENABLE
+ SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
+endif
+
+ifeq ($(strip $(PRINTING_ENABLE)), yes)
+ OPT_DEFS += -DPRINTING_ENABLE
+ SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c
+ SRC += $(TMK_DIR)/protocol/serial_uart.c
+endif
+
+ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
+ SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
+ OPT_DEFS += $(SERIAL_DEFS)
+ VAPTH += $(SERIAL_PATH)
+endif
+
+ifneq ($(strip $(VARIABLE_TRACE)),)
+ SRC += $(QUANTUM_DIR)/variable_trace.c
+ OPT_DEFS += -DNUM_TRACED_VARIABLES=$(strip $(VARIABLE_TRACE))
+ifneq ($(strip $(MAX_VARIABLE_TRACE_SIZE)),)
+ OPT_DEFS += -DMAX_VARIABLE_TRACE_SIZE=$(strip $(MAX_VARIABLE_TRACE_SIZE))
+endif
+endif
+
+ifeq ($(strip $(LCD_ENABLE)), yes)
+ CIE1931_CURVE = yes
+endif
+
+ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
+ ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
+ CIE1931_CURVE = yes
+ endif
+endif
+
+ifeq ($(strip $(CIE1931_CURVE)), yes)
+ OPT_DEFS += -DUSE_CIE1931_CURVE
+ LED_TABLES = yes
+endif
+
+ifeq ($(strip $(LED_BREATHING_TABLE)), yes)
+ OPT_DEFS += -DUSE_LED_BREATHING_TABLE
+ LED_TABLES = yes
+endif
+
+ifeq ($(strip $(LED_TABLES)), yes)
+ SRC += $(QUANTUM_DIR)/led_tables.c
+endif