# Inspired by Makefile from https://github.com/Felerius/planck-layout

keyboard := geeboard
layout := bone2planck
qmk_dir := ../external/qmk_firmware
keyboard_dir := ${qmk_dir}/keyboards/${keyboard}

.PHONY: build
build: ${keyboard_dir}
	$(MAKE) -C ${qmk_dir} ${keyboard}:${layout}

.PHONY: flash
flash: ${keyboard_dir}
	$(MAKE) -C ${qmk_dir} ${keyboard}:${layout}:flash

.PHONY: clean
clean:
	$(MAKE) -C ${qmk_dir} clean
	rm ${keyboard_dir}

# execute any qmk make target e.g. other keyboard/keymaps
.PHONY: %
%:
	$(MAKE) -C ${qmk_dir} $@

${keyboard_dir}:
	ln -sf "../../../geeboard_firmware" $@

