@ -40,13 +40,16 @@ endif
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 $( ARDUINO_DIRECTORIES_USER ) /hardware /keyboardio /avr /boards .txt $( ARDUINO_DIRECTORIES_USER ) /hardware /keyboardio /virtual /boards .txt
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
@:
@:
.PHONY : prepare -virtual
prepare-virtual : $( ARDUINO_DIRECTORIES_USER ) /hardware /keyboardio /virtual /boards .txt
prepare-virtual : $( ARDUINO_DIRECTORIES_USER ) /hardware /keyboardio /virtual /boards .txt
@:
@:
@ -68,27 +71,33 @@ $(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 : 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"
.PHONY : run -tests
run-tests : $( ARDUINO_DIRECTORIES_USER ) /hardware /keyboardio /virtual /boards .txt build -gtest -gmock
run-tests : $( ARDUINO_DIRECTORIES_USER ) /hardware /keyboardio /virtual /boards .txt build -gtest -gmock
$( MAKE) -c tests
$( MAKE) -c tests
@: # blah
@: # blah
@ -97,17 +106,19 @@ 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
.PHONY : find -filename -conflicts
find-filename-conflicts :
find-filename-conflicts :
bin/find-filename-conflicts.py src plugins/*
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
.PHONY : check -formatting
check-formatting :
check-formatting :
bin/format-code.py \
bin/format-code.py \
--exclude-dir 'testing/googletest' \
--exclude-dir 'testing/googletest' \
@ -116,13 +127,16 @@ check-formatting:
--verbose \
--verbose \
src plugins examples testing
src plugins examples testing
.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
shellcheck :
shellcheck :
bin/check-shell-scripts.sh
bin/check-shell-scripts.sh
@ -131,14 +145,14 @@ SMOKE_SKETCHES := $(sort $(shell if [ -d ./examples ]; then find ./examples -typ
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 : 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/*"
.PHONY : force
$(SMOKE_SKETCHES) : force
$(SMOKE_SKETCHES) : force
$( MAKE) -C $@ -f $( KALEIDOSCOPE_ETC_DIR) /makefiles/sketch.mk compile
$( MAKE) -C $@ -f $( KALEIDOSCOPE_ETC_DIR) /makefiles/sketch.mk compile