summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorChristopher Browne <cbbrowne@ca.afilias.info>2016-07-04 12:32:08 -0400
committerChristopher Browne <cbbrowne@ca.afilias.info>2016-07-04 12:32:08 -0400
commit2e1cfaf73fccdfaba2d7542f00bd7c3d49998d5d (patch)
tree9d8e9c6b71116f01c56c870a9e1071760899ff77 /Makefile
parent44a5f7630f18b40b36270d49449a43cd42b802f0 (diff)
parent9e01b219f32b0086728c10658928b8bffcc26ef7 (diff)
Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 29 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index f9b865b9f8..c285dabad4 100644
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,8 @@ ifndef VERBOSE
.SILENT:
endif
+.DEFAULT_GOAL := all
+
space := $(subst ,, )
starting_makefile := $(subst $(space),_SPACE_,$(abspath $(firstword $(MAKEFILE_LIST))))
mkfile_path := $(subst $(space),_SPACE_,$(abspath $(lastword $(MAKEFILE_LIST))))
@@ -41,6 +43,7 @@ endif
TOP_DIR = $(tmk_root)
TMK_DIR = tmk_core
TMK_PATH = $(TOP_DIR)/$(TMK_DIR)
+LIB_PATH = $(TOP_DIR)/lib
QUANTUM_DIR = quantum
QUANTUM_PATH = $(TOP_DIR)/$(QUANTUM_DIR)
@@ -126,6 +129,13 @@ ifdef SUBPROJECT
else
TARGET ?= $(KEYBOARD)_$(KEYMAP)
endif
+BUILD_DIR = .build
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = $(BUILD_DIR)/obj_$(TARGET)
+
ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
@@ -143,7 +153,7 @@ endif
SRC += $(KEYBOARD_FILE) \
$(KEYMAP_FILE) \
$(QUANTUM_DIR)/quantum.c \
- $(QUANTUM_DIR)/keymap.c \
+ $(QUANTUM_DIR)/keymap_common.c \
$(QUANTUM_DIR)/keycode_config.c \
$(QUANTUM_DIR)/process_keycode/process_leader.c
@@ -208,8 +218,25 @@ VPATH += $(QUANTUM_PATH)/keymap_extras
VPATH += $(QUANTUM_PATH)/audio
VPATH += $(QUANTUM_PATH)/process_keycode
-include $(TMK_PATH)/protocol/lufa.mk
+
+# We can assume a ChibiOS target When MCU_FAMILY is defined, since it's not used for LUFA
+ifdef MCU_FAMILY
+ PLATFORM=CHIBIOS
+else
+ PLATFORM=AVR
+endif
+
include $(TMK_PATH)/common.mk
+ifeq ($(PLATFORM),AVR)
+ include $(TMK_PATH)/protocol/lufa.mk
+ include $(TMK_PATH)/avr.mk
+else ifeq ($(PLATFORM),CHIBIOS)
+ include $(TMK_PATH)/protocol/chibios.mk
+ include $(TMK_PATH)/chibios.mk
+else
+ $(error Unknown platform)
+endif
+
include $(TMK_PATH)/rules.mk
GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")