forked from mirrors/qmk_userspace
Implements subprojects and updates projects for this (#459)
* non-working commit * working * subprojects implemented for planck * pass a subproject variable through to c * consolidates clueboard revisions * thanks for letting me know about conflicts.. * turn off audio for yang's * corrects starting paths for subprojects * messing around with travis * semicolon * travis script * travis script * script for travis * correct directory (probably), amend files to commit * remove origin before adding * git pull, correct syntax * git checkout * git pull origin branch * where are we? * where are we? * merging * force things to happen * adds commit message, adds add * rebase, no commit message * rebase branch * idk! * try just pull * fetch - merge * specify repo branch * checkout * goddammit * merge? idk * pls * after all * don't split up keyboards * syntax * adds quick for all-keyboards * trying out new script * script update * lowercase * all keyboards * stop replacing compiled.hex automatically * adds if statement * skip automated build branches * forces push to automated build branch * throw an add in there * upstream? * adds AUTOGEN * ignore all .hex files again * testing out new repo * global ident * generate script, keyboard_keymap.hex * skip generation for now, print pandoc info, submodule update * try trusty * and sudo * try generate * updates subprojects to keyboards * no idea * updates to keyboards * cleans up clueboard stuff * setup to use local readme * updates cluepad, planck experimental * remove extra led.c [ci skip] * disable power up for now * config files updates * makefile updates * .h file updates, config tuning * disable audio for yang
This commit is contained in:
parent
755b17f8fc
commit
215c2119af
44 changed files with 480 additions and 475 deletions
68
Makefile
68
Makefile
|
@ -10,19 +10,32 @@ abs_tmk_root := $(patsubst %/,%,$(dir $(mkfile_path)))
|
|||
ifneq (,$(findstring /keyboards/,$(starting_makefile)))
|
||||
possible_keyboard:=$(patsubst %/,%,$(dir $(patsubst $(abs_tmk_root)/keyboards/%,%,$(starting_makefile))))
|
||||
ifneq (,$(findstring /keymaps/,$(possible_keyboard)))
|
||||
KEYBOARD_DIR:=$(firstword $(subst /keymaps/, ,$(possible_keyboard)))
|
||||
KEYMAP_DIR:=$(lastword $(subst /keymaps/, ,$(possible_keyboard)))
|
||||
tmk_root = ../../../..
|
||||
KEYBOARD_DIR:=$(firstword $(subst /keymaps/, ,$(possible_keyboard)))
|
||||
ifneq (,$(findstring /,$(KEYBOARD_DIR)))
|
||||
# SUBPROJECT_DIR:=$(lastword $(subst /, ,$(KEYBOARD_DIR)))
|
||||
# KEYBOARD_DIR:=$(firstword $(subst /, ,$(KEYBOARD_DIR)))
|
||||
tmk_root = ../../..
|
||||
else
|
||||
tmk_root = ../../../..
|
||||
endif
|
||||
else
|
||||
KEYBOARD_DIR:=$(possible_keyboard)
|
||||
KEYMAP_DIR:=default
|
||||
tmk_root = ../..
|
||||
KEYBOARD_DIR:=$(possible_keyboard)
|
||||
ifneq (,$(findstring /,$(KEYBOARD_DIR)))
|
||||
# SUBPROJECT_DIR:=$(lastword $(subst /, ,$(KEYBOARD_DIR)))
|
||||
# KEYBOARD_DIR:=$(firstword $(subst /, ,$(KEYBOARD_DIR)))
|
||||
tmk_root = ../../..
|
||||
else
|
||||
tmk_root = ../..
|
||||
endif
|
||||
endif
|
||||
else
|
||||
tmk_root = .
|
||||
endif
|
||||
# $(info $(KEYBOARD_DIR))
|
||||
# $(info $(KEYMAP_DIR))
|
||||
# $(info $(SUBPROJECT_DIR))
|
||||
|
||||
# Directory common source filess exist
|
||||
TOP_DIR = $(tmk_root)
|
||||
|
@ -32,6 +45,7 @@ TMK_PATH = $(TOP_DIR)/$(TMK_DIR)
|
|||
QUANTUM_DIR = quantum
|
||||
QUANTUM_PATH = $(TOP_DIR)/$(QUANTUM_DIR)
|
||||
|
||||
|
||||
ifdef keyboard
|
||||
KEYBOARD ?= $(keyboard)
|
||||
endif
|
||||
|
@ -41,7 +55,16 @@ endif
|
|||
ifndef KEYBOARD
|
||||
KEYBOARD=planck
|
||||
endif
|
||||
|
||||
# converts things to keyboards/subproject
|
||||
ifneq (,$(findstring /,$(KEYBOARD)))
|
||||
TEMP:=$(KEYBOARD)
|
||||
KEYBOARD:=$(firstword $(subst /, ,$(TEMP)))
|
||||
SUBPROJECT:=$(lastword $(subst /, ,$(TEMP)))
|
||||
endif
|
||||
|
||||
KEYBOARD_PATH = $(TOP_DIR)/keyboards/$(KEYBOARD)
|
||||
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH)/$(KEYBOARD).c)","")
|
||||
KEYBOARD_FILE = keyboards/$(KEYBOARD)/$(KEYBOARD).c
|
||||
ifndef ARCH
|
||||
|
@ -51,6 +74,28 @@ else
|
|||
$(error "$(KEYBOARD_PATH)/$(KEYBOARD).c" does not exist)
|
||||
endif
|
||||
|
||||
ifdef sub
|
||||
SUBPROJECT=$(sub)
|
||||
endif
|
||||
ifdef subproject
|
||||
SUBPROJECT=$(subproject)
|
||||
endif
|
||||
|
||||
ifdef SUBPROJECT_DEFAULT
|
||||
SUBPROJECT?=$(SUBPROJECT_DEFAULT)
|
||||
endif
|
||||
|
||||
ifdef SUBPROJECT
|
||||
SUBPROJECT_PATH = $(TOP_DIR)/keyboards/$(KEYBOARD)/$(SUBPROJECT)
|
||||
ifneq ("$(wildcard $(SUBPROJECT_PATH)/$(SUBPROJECT).c)","")
|
||||
OPT_DEFS += -DSUBPROJECT_$(SUBPROJECT)
|
||||
SUBPROJECT_FILE = keyboards/$(KEYBOARD)/$(SUBPROJECT)/$(SUBPROJECT).c
|
||||
-include $(SUBPROJECT_PATH)/Makefile
|
||||
else
|
||||
$(error "$(SUBPROJECT_PATH)/$(SUBPROJECT).c" does not exist)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef keymap
|
||||
KEYMAP ?= $(keymap)
|
||||
endif
|
||||
|
@ -68,7 +113,13 @@ else
|
|||
$(error "$(KEYMAP_PATH)/keymap.c" does not exist)
|
||||
endif
|
||||
|
||||
TARGET ?= $(KEYBOARD)_$(KEYMAP)
|
||||
ifdef SUBPROJECT
|
||||
TARGET ?= $(KEYBOARD)_$(SUBPROJECT)_$(KEYMAP)
|
||||
else
|
||||
TARGET ?= $(KEYBOARD)_$(KEYMAP)
|
||||
endif
|
||||
|
||||
|
||||
|
||||
ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
|
||||
CONFIG_H = $(KEYMAP_PATH)/config.h
|
||||
|
@ -83,6 +134,10 @@ SRC += $(KEYBOARD_FILE) \
|
|||
$(QUANTUM_DIR)/keymap.c \
|
||||
$(QUANTUM_DIR)/keycode_config.c
|
||||
|
||||
ifdef SUBPROJECT
|
||||
SRC += $(SUBPROJECT_FILE)
|
||||
endif
|
||||
|
||||
ifndef CUSTOM_MATRIX
|
||||
SRC += $(QUANTUM_DIR)/matrix.c
|
||||
endif
|
||||
|
@ -104,6 +159,9 @@ endif
|
|||
|
||||
# Search Path
|
||||
VPATH += $(KEYMAP_PATH)
|
||||
ifdef SUBPROJECT
|
||||
VPATH += $(SUBPROJECT_PATH)
|
||||
endif
|
||||
VPATH += $(KEYBOARD_PATH)
|
||||
VPATH += $(TOP_DIR)
|
||||
VPATH += $(TMK_PATH)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue