X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=tmk_core%2Fcommon.mk;h=9c3425b41bbb0e445124c88759128b797b778731;hb=3e8289b53ce929484651fc065fb5f718e4e3ae21;hp=d22adff519c3d7836f79d5120b5752ace205a4ad;hpb=f1f2066657f4a0998adc016c95d7e541b436e09f;p=max%2Ftmk_keyboard.git diff --git a/tmk_core/common.mk b/tmk_core/common.mk index d22adff5..9c3425b4 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -1,15 +1,16 @@ COMMON_DIR = common SRC += $(COMMON_DIR)/host.c \ $(COMMON_DIR)/keyboard.c \ + $(COMMON_DIR)/matrix.c \ $(COMMON_DIR)/action.c \ $(COMMON_DIR)/action_tapping.c \ $(COMMON_DIR)/action_macro.c \ $(COMMON_DIR)/action_layer.c \ $(COMMON_DIR)/action_util.c \ - $(COMMON_DIR)/keymap.c \ $(COMMON_DIR)/print.c \ $(COMMON_DIR)/debug.c \ $(COMMON_DIR)/util.c \ + $(COMMON_DIR)/hook.c \ $(COMMON_DIR)/avr/suspend.c \ $(COMMON_DIR)/avr/xprintf.S \ $(COMMON_DIR)/avr/timer.c \ @@ -17,60 +18,99 @@ SRC += $(COMMON_DIR)/host.c \ # Option modules -ifdef BOOTMAGIC_ENABLE +ifeq (yes,$(strip $(UNIMAP_ENABLE))) + SRC += $(COMMON_DIR)/unimap.c + OPT_DEFS += -DUNIMAP_ENABLE + OPT_DEFS += -DACTIONMAP_ENABLE +else + ifeq (yes,$(strip $(ACTIONMAP_ENABLE))) + SRC += $(COMMON_DIR)/actionmap.c + OPT_DEFS += -DACTIONMAP_ENABLE + else + SRC += $(COMMON_DIR)/keymap.c + endif +endif + +ifeq (yes,$(strip $(BOOTMAGIC_ENABLE))) SRC += $(COMMON_DIR)/bootmagic.c SRC += $(COMMON_DIR)/avr/eeconfig.c OPT_DEFS += -DBOOTMAGIC_ENABLE endif -ifdef MOUSEKEY_ENABLE +ifeq (yes,$(strip $(MOUSEKEY_ENABLE))) SRC += $(COMMON_DIR)/mousekey.c OPT_DEFS += -DMOUSEKEY_ENABLE OPT_DEFS += -DMOUSE_ENABLE endif -ifdef EXTRAKEY_ENABLE +ifeq (yes,$(strip $(EXTRAKEY_ENABLE))) OPT_DEFS += -DEXTRAKEY_ENABLE endif -ifdef CONSOLE_ENABLE +ifeq (yes,$(strip $(CONSOLE_ENABLE))) OPT_DEFS += -DCONSOLE_ENABLE else - OPT_DEFS += -DNO_PRINT + # Remove print functions when console is disabled and + # no other print method like UART is available + ifneq (yes, $(strip $(DEBUG_PRINT_AVAILABLE))) + OPT_DEFS += -DNO_PRINT + OPT_DEFS += -DNO_DEBUG + endif +endif + +ifeq (yes,$(strip $(NO_DEBUG))) OPT_DEFS += -DNO_DEBUG endif -ifdef COMMAND_ENABLE +ifeq (yes,$(strip $(NO_PRINT))) + OPT_DEFS += -DNO_PRINT +endif + +ifeq (yes,$(strip $(COMMAND_ENABLE))) SRC += $(COMMON_DIR)/command.c OPT_DEFS += -DCOMMAND_ENABLE endif -ifdef NKRO_ENABLE +ifeq (yes,$(strip $(NKRO_ENABLE))) OPT_DEFS += -DNKRO_ENABLE endif -ifdef USB_6KRO_ENABLE +ifeq (yes,$(strip $(USB_6KRO_ENABLE))) OPT_DEFS += -DUSB_6KRO_ENABLE endif -ifdef SLEEP_LED_ENABLE - SRC += $(COMMON_DIR)/sleep_led.c +ifeq (yes, $(strip $(KEYBOARD_LOCK_ENABLE))) + OPT_DEFS += -DKEYBOARD_LOCK_ENABLE +endif + +ifeq (yes,$(strip $(SLEEP_LED_ENABLE))) + SRC += $(COMMON_DIR)/avr/sleep_led.c OPT_DEFS += -DSLEEP_LED_ENABLE OPT_DEFS += -DNO_SUSPEND_POWER_DOWN endif -ifdef BACKLIGHT_ENABLE +ifeq (yes,$(strip $(BACKLIGHT_ENABLE))) SRC += $(COMMON_DIR)/backlight.c OPT_DEFS += -DBACKLIGHT_ENABLE endif -ifdef KEYMAP_SECTION_ENABLE +ifeq (yes,$(strip $(KEYMAP_SECTION_ENABLE))) OPT_DEFS += -DKEYMAP_SECTION_ENABLE - EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr5.x + + ifeq ($(strip $(MCU)),atmega32u2) + EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr35.x + else ifeq ($(strip $(MCU)),atmega32u4) + EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr5.x + else ifeq ($(strip $(MCU)),at90usb1286) + EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr51.x + else + EXTRALDFLAGS = $(error no ldscript for keymap section) + endif endif # Version string -OPT_DEFS += -DVERSION=$(shell (git describe --always --dirty || echo 'unknown') 2> /dev/null) +TMK_VERSION := $(shell (git describe --always --dirty=+ || echo 'unknown') 2> /dev/null) +OPT_DEFS += -DTMK_VERSION=$(TMK_VERSION) # Search Path