qmk build system

This commit is contained in:
Jimmy
2020-07-14 13:48:10 +08:00
parent f31e2d4a6d
commit 2c7390deb3
56 changed files with 2638 additions and 1 deletions

47
arch/Makefile Normal file
View File

@@ -0,0 +1,47 @@
###################################################################
#automatic detection QTOP and LOCALDIR
CUR_DIR := $(patsubst %/,%,$(dir $(realpath $(firstword $(MAKEFILE_LIST)))))
TRYQTOP := $(shell if [ -n "$$QTOP" ] ; then\
echo $$QTOP;\
else\
cd $(CUR_DIR); while /usr/bin/test ! -d qmk ; do \
dir=`cd ../;pwd`; \
if [ "$$dir" = "/" ] ; then \
echo Cannot find QTOP in $(firstword $(MAKEFILE_LIST)) 1>&2; \
exit 1; \
fi ; \
cd $$dir; \
done ; \
pwd; \
fi)
QTOP ?= $(realpath ${TRYQTOP})
ifeq ($(QTOP),)
$(error Please run this in a tree)
endif
LOCALDIR = $(patsubst %/,%,$(subst $(realpath $(QTOP))/,,$(CUR_DIR)))
####################################################################
TREE_LIB_ENABLE=0
lib=
subdirs=
ifneq (help,$(findstring help,$(MAKECMDGOALS)))
ifeq (, $(strip ${BP}))
$(error when compile arch/, must specify BP and ARCH_LSRCS obviously , see `make help`)
endif
include ${QTOP}/qmk/board-pack/bp.${BP}
ifeq (,$(strip ${ARCH_LSCRS}))
$(error when compile arch/, must specify BP and ARCH_LSRCS obviously , see `make help`)
endif
endif
# arch src should be specify by bp
LSRCS:=$(subst $(QTOP)/$(LOCALDIR)/,, ${ARCH_LSCRS})
include ${QTOP}/qmk/generic/Make.tpl