summaryrefslogtreecommitdiff
path: root/keyboard/planck/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'keyboard/planck/Makefile')
-rw-r--r--keyboard/planck/Makefile21
1 files changed, 19 insertions, 2 deletions
diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile
index 485c5f77f6..16d462b699 100644
--- a/keyboard/planck/Makefile
+++ b/keyboard/planck/Makefile
@@ -53,11 +53,28 @@ TARGET_DIR = .
SRC = planck.c \
backlight.c
+ifdef keymap
+ KEYMAP = $(keymap)
+endif
+
ifdef KEYMAP
- SRC := keymaps/keymap_$(KEYMAP).c $(SRC)
+ifneq ("$(wildcard keymaps/$(KEYMAP).c)","")
+ KEYMAP_FILE = keymaps/$(KEYMAP).c
+else
+ifneq ("$(wildcard keymaps/$(KEYMAP)/keymap.c)","")
+ KEYMAP_FILE = keymaps/$(KEYMAP)/keymap.c
+else
+$(error Keymap file does not exist)
+endif
+endif
else
- SRC := keymaps/keymap_default.c $(SRC)
+ifneq ("$(wildcard keymaps/default.c)","")
+ KEYMAP_FILE = keymaps/default.c
+else
+ KEYMAP_FILE = keymaps/default/keymap.c
+endif
endif
+SRC := $(KEYMAP_FILE) $(SRC)
CONFIG_H = config.h