@ -36,24 +36,16 @@ ifneq ($(TEST_PATH),)
TEST_PATH_ARG = " TEST_PATH=' $( TEST_PATH) ' "
TEST_PATH_ARG = " TEST_PATH=' $( TEST_PATH) ' "
e n d i f
e n d i f
.DEFAULT_GOAL := smoke-sketches
DEFAULT_GOAL : smoke -sketches
.PHONY : setup
setup : $( ARDUINO_CLI_PATH ) $( ARDUINO_DIRECTORIES_DATA ) /arduino -cli .yaml install -arduino -core -avr install -arduino -core -kaleidoscope checkout -platform prepare -virtual
setup : $( ARDUINO_CLI_PATH ) $( ARDUINO_DIRECTORIES_DATA ) /arduino -cli .yaml install -arduino -core -avr install -arduino -core -kaleidoscope $( ARDUINO_DIRECTORIES_USER ) /hardware /keyboardio /avr /boards .txt $( ARDUINO_DIRECTORIES_USER ) /hardware /keyboardio /virtual /boards .txt
@:
@:
.PHONY : checkout -platform
checkout-platform : $( ARDUINO_DIRECTORIES_USER ) /hardware /keyboardio /avr /boards .txt
checkout-platform : $( ARDUINO_DIRECTORIES_USER ) /hardware /keyboardio /avr /boards .txt
@:
@:
prepare-virtual : $( ARDUINO_DIRECTORIES_USER ) /hardware /keyboardio /virtual /boards .txt
@:
$(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/virtual/boards.txt :
$( MAKE) -C $( ARDUINO_DIRECTORIES_USER) /hardware/keyboardio prepare-virtual
$(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/boards.txt :
$(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/boards.txt :
git clone -c core.symlinks= true \
git clone -c core.symlinks= true \
--recurse-submodules \
--recurse-submodules \
@ -68,90 +60,97 @@ $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/boards.txt:
--recurse-submodules= ':(exclude)libraries/Kaleidoscope' \
--recurse-submodules= ':(exclude)libraries/Kaleidoscope' \
https://github.com/keyboardio/ArduinoCore-GD32-Keyboardio $( ARDUINO_DIRECTORIES_USER) /hardware/keyboardio/gd32
https://github.com/keyboardio/ArduinoCore-GD32-Keyboardio $( ARDUINO_DIRECTORIES_USER) /hardware/keyboardio/gd32
.PHONY : prepare -virtual
prepare-virtual : $( ARDUINO_DIRECTORIES_USER ) /hardware /keyboardio /virtual /boards .txt
@:
$(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/virtual/boards.txt :
$( MAKE) -C $( ARDUINO_DIRECTORIES_USER) /hardware/keyboardio prepare-virtual
.PHONY : update
update :
update :
cd $( ARDUINO_DIRECTORIES_USER) /hardware/keyboardio; git pull; \
cd $( ARDUINO_DIRECTORIES_USER) /hardware/keyboardio; git pull; \
git submodule update --init --recursive
git submodule update --init --recursive
cd $( ARDUINO_DIRECTORIES_USER) /hardware/keyboardio/gd32; git pull; \
cd $( ARDUINO_DIRECTORIES_USER) /hardware/keyboardio/gd32; git pull; \
git submodule update --init --recursive
git submodule update --init --recursive
.PHONY : simulator -tests
simulator-tests :
simulator-tests :
i f n e q ( $( _using_old_make ) , )
i f n e q ( $( _using_old_make ) , )
$( info You're using an older version of GNU Make that doesn' t offer the --output-sync option. If you' re running the test suite in parallel, output may be garbled. You might consider using GNU Make 4.0 or later instead)
$( info You're using an older version of GNU Make that doesn' t offer the --output-sync option. If you' re running the test suite in parallel, output may be garbled. You might consider using GNU Make 4.0 or later instead)
e n d i f
e n d i f
$( MAKE) -C tests all
$( MAKE) -C tests all
.PHONY : docker -simulator -tests
docker-simulator-tests :
docker-simulator-tests :
ARDUINO_DIRECTORIES_USER = " $( ARDUINO_DIRECTORIES_USER) " ./bin/run-docker " make simulator-tests $( TEST_PATH_ARG) "
ARDUINO_DIRECTORIES_USER = " $( ARDUINO_DIRECTORIES_USER) " ./bin/run-docker " make simulator-tests $( TEST_PATH_ARG) "
.PHONY : docker -clean
docker-clean :
docker-clean :
_NO_SYNC_KALEIDOSCOPE = 1 ARDUINO_DIRECTORIES_USER = " $( ARDUINO_DIRECTORIES_USER) " ./bin/run-docker "rm -rf -- testing/googletest/build/* _build/* /kaleidoscope-persist/temp/*"
_NO_SYNC_KALEIDOSCOPE = 1 ARDUINO_DIRECTORIES_USER = " $( ARDUINO_DIRECTORIES_USER) " ./bin/run-docker "rm -rf -- testing/googletest/build/* _build/* /kaleidoscope-persist/temp/*"
.PHONY : docker -bash
docker-bash :
docker-bash :
_NO_SYNC_KALEIDOSCOPE = 1 DOCKER_LIVE_KALEIDOSCOPE_DIR = 1 ARDUINO_DIRECTORIES_USER = " $( ARDUINO_DIRECTORIES_USER) " ./bin/run-docker "bash"
_NO_SYNC_KALEIDOSCOPE = 1 DOCKER_LIVE_KALEIDOSCOPE_DIR = 1 ARDUINO_DIRECTORIES_USER = " $( ARDUINO_DIRECTORIES_USER) " ./bin/run-docker "bash"
run-tests : $( ARDUINO_DIRECTORIES_USER ) /hardware /keyboardio /virtual /boards .txt build -gtest -gmock
$( MAKE) -c tests
@: # blah
build-gtest-gmock :
build-gtest-gmock :
( cd testing/googletest && cmake -H. -Bbuild -DCMAKE_C_COMPILER= $( call _arduino_prop,compiler.path) $( call _arduino_prop,compiler.c.cmd) -DCMAKE_CXX_COMPILER= $( call _arduino_prop,compiler.path) $( call _arduino_prop,compiler.cpp.cmd) .)
( cd testing/googletest && cmake -H. -Bbuild -DCMAKE_C_COMPILER= $( call _arduino_prop,compiler.path) $( call _arduino_prop,compiler.c.cmd) -DCMAKE_CXX_COMPILER= $( call _arduino_prop,compiler.path) $( call _arduino_prop,compiler.cpp.cmd) .)
$( MAKE) -C testing/googletest
$( MAKE) -C testing/googletest
adjust-git-timestamps :
.PHONY : find -filename -conflicts
bin/set-timestamps-from-git
find-filename-conflicts :
find-filename-conflicts :
bin/find-filename-conflicts
bin/find-filename-conflicts.py src plugins/*
.PHONY : format check -formatting cpplint cpplint -noisy shellcheck smoke -examples find -filename -conflicts prepare -virtual checkout -platform adjust -git -timestamps docker -bash docker -simulator -tests run -tests simulator -tests setup
.PHONY : format
format :
format :
bin/format-code.py \
bin/format-code.py \
--exclude-dir 'testing/googletest' \
--exclude-dir 'testing/googletest' \
--exclude-file 'generated-testcase.cpp' \
--exclude-file 'generated-testcase.cpp' \
src plugins examples testing
src plugins examples testing
check-formatting :
.PHONY : check -code -style
check-code-style :
bin/format-code.py \
bin/format-code.py \
--exclude-dir 'testing/googletest' \
--exclude-dir 'testing/googletest' \
--exclude-file 'generated-testcase.cpp' \
--exclude-file 'generated-testcase.cpp' \
--force \
--check \
--check \
--verbose \
--verbose \
src plugins examples testing
src plugins examples testing
.PHONY : check -includes
check-includes :
bin/iwyu.py -v src plugins
bin/format-code.py -f -v --check src plugins
.PHONY : cpplint -noisy
cpplint-noisy :
cpplint-noisy :
-bin/cpplint.py --config= .cpplint-noisy --recursive src plugins examples
-bin/cpplint.py --config= .cpplint-noisy --recursive src plugins examples
.PHONY : cpplint
cpplint :
cpplint :
bin/cpplint.py --config= .cpplint --quiet --recursive src plugins examples
bin/cpplint.py --config= .cpplint --quiet --recursive src plugins examples
.PHONY : shellcheck
SHELL_FILES := $( shell if [ -d bin ] ; then egrep -n -r -l "(env (ba)?sh)|(/bin/(ba)?sh)" bin; fi )
shellcheck :
shellcheck :
@if [ -d "bin" ] ; then \
bin/check-shell-scripts.sh
shellcheck ${ SHELL_FILES } ; \
fi
SMOKE_SKETCHES := $( sort $( shell if [ -d ./examples ] ; then find ./examples -type f -name \* ino | xargs -n 1 dirname; fi ) )
SMOKE_SKETCHES := $( sort $( shell if [ -d ./examples ] ; then find ./examples -type f -name \* ino | xargs -n 1 dirname; fi ) )
smoke-sketches : $( SMOKE_SKETCHES )
smoke-sketches : $( SMOKE_SKETCHES )
@echo "Smoke-tested all the sketches"
@echo "Smoke-tested all the sketches"
.PHONY : force all clean test
.PHONY : force
$(SMOKE_SKETCHES) : force
$( MAKE) -C $@ -f $( KALEIDOSCOPE_ETC_DIR) /makefiles/sketch.mk compile
.PHONY : clean
clean :
clean :
$( MAKE) -C tests clean
$( MAKE) -C tests clean
rm -rf -- "testing/googletest/build/*"
rm -rf -- "testing/googletest/build/*"
rm -rf -- "_build/*"
rm -rf -- "_build/*"
$(SMOKE_SKETCHES) : force
$( MAKE) -C $@ -f $( KALEIDOSCOPE_ETC_DIR) /makefiles/sketch.mk compile
build-arduino-nightly-package :
build-arduino-nightly-package :
perl bin/build-arduino-package \
perl bin/build-arduino-package \
--kaleidoscope-tag= master \
--kaleidoscope-tag= master \