Skip to content

Commit

Permalink
Properly process Userspace files
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna committed May 9, 2020
1 parent 6919772 commit c883c1b
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions build_keyboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_1)/rules.mk)","")
include $(KEYBOARD_PATH_1)/rules.mk
endif

# Userspace setup and definitions.
# Process before keymaps, but after keyboards.
ifeq ("$(USER_NAME)","")
USER_NAME := $(KEYMAP)
endif
USER_PATH := users/$(USER_NAME)
-include $(USER_PATH)/rules.mk

MAIN_KEYMAP_PATH_1 := $(KEYBOARD_PATH_1)/keymaps/$(KEYMAP)
MAIN_KEYMAP_PATH_2 := $(KEYBOARD_PATH_2)/keymaps/$(KEYMAP)
Expand Down Expand Up @@ -279,13 +286,9 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_5)/post_config.h)","")
POST_CONFIG_H += $(KEYBOARD_PATH_5)/post_config.h
endif

# Userspace setup and definitions
ifeq ("$(USER_NAME)","")
USER_NAME := $(KEYMAP)
endif
USER_PATH := users/$(USER_NAME)

-include $(USER_PATH)/rules.mk
# Userspace makefile second pass
-include $(USER_PATH)/post_keymap.mk
# Userspace config.h first pass
ifneq ("$(wildcard $(USER_PATH)/config.h)","")
CONFIG_H += $(USER_PATH)/config.h
endif
Expand All @@ -299,6 +302,11 @@ ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
CONFIG_H += $(KEYMAP_PATH)/config.h
endif

# Userspace post config.h pass
ifneq ("$(wildcard $(USER_PATH)/config.h)","")
POST_CONFIG_H += $(USER_PATH)/post_config.h
endif

# project specific files
SRC += $(KEYBOARD_SRC) \
$(KEYMAP_C) \
Expand Down

0 comments on commit c883c1b

Please sign in to comment.