~ruther/qmk_firmware

e5726b017a9de2922ea923818c6e215600f68a85 — Fred Sundvik 9 years ago 4b45deb
Add setting of the master side to the makefile
2 files changed, 23 insertions(+), 0 deletions(-)

M Makefile
M tmk_core/common.mk
M Makefile => Makefile +14 -0
@@ 59,6 59,12 @@ ifndef KEYBOARD
	KEYBOARD=planck
endif

MASTER ?= left
ifdef master
	MASTER = $(master)
endif


# converts things to keyboards/subproject
ifneq (,$(findstring /,$(KEYBOARD)))
	TEMP:=$(KEYBOARD)


@@ 212,6 218,14 @@ ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
	VAPTH += $(SERIAL_PATH)
endif

ifeq ($(MASTER),right)	
	OPT_DEFS += -DMASTER_IS_ON_RIGHT
else 
	ifneq ($(MASTER),left)
$(error MASTER does not have a valid value(left/right))
	endif
endif

# Optimize size but this may cause error "relocation truncated to fit"
#EXTRALDFLAGS = -Wl,--relax


M tmk_core/common.mk => tmk_core/common.mk +9 -0
@@ 97,6 97,15 @@ ifeq ($(strip $(KEYMAP_SECTION_ENABLE)), yes)
    endif
endif

ifeq ($(MASTER),right)	
	OPT_DEFS += -DMASTER_IS_ON_RIGHT
else 
	ifneq ($(MASTER),left)
$(error MASTER does not have a valid value(left/right))
	endif
endif


# Version string
OPT_DEFS += -DVERSION=$(shell (git describe --always --dirty || echo 'unknown') 2> /dev/null)