]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Add setting of the master side to the makefile
authorFred Sundvik <fsundvik@gmail.com>
Wed, 6 Jul 2016 12:36:45 +0000 (15:36 +0300)
committerFred Sundvik <fsundvik@gmail.com>
Wed, 6 Jul 2016 13:06:53 +0000 (16:06 +0300)
Makefile
tmk_core/common.mk

index cfbe0e994d76cf97f76137746e1e69c101b3dc22..7c00ce2cc888174a325a6a5d1f8abe5c15b1b67d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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
 
index d71fba9bc1990013543d1bbef6de2243d9e7b411..5bae0d762f41181f84333b51093abcc14a0ac4c9 100644 (file)
@@ -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)