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 7b06446d74..dece6a7f17 100644
--- a/keyboard/planck/Makefile
+++ b/keyboard/planck/Makefile
@@ -52,11 +52,28 @@ TARGET_DIR = .
# # project specific files
SRC = planck.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