Skip to content

Commit

Permalink
Add setting of the master side to the makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
fredizzimo committed Jul 6, 2016
1 parent 4b45deb commit e5726b0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
9 changes: 9 additions & 0 deletions tmk_core/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit e5726b0

Please sign in to comment.