tinygo-org / tinyfont

Text library for TinyGo displays
https://tinygo.org
BSD 3-Clause "New" or "Revised" License
49 stars 12 forks source link

Add Makefile for CI test #11

Closed sago35 closed 4 years ago

sago35 commented 4 years ago

Resolves #9

Based on a Makefile from the tinygo project. At the moment, smoketest and clean and fmt and fmt-check work. all is empty because there is nothing to do.

I checked it with bash on windows. I checked it with docker (tinygo/tinygo-dev).

The examples_*.hex target is created separately so that it can be accelerated with make -j4 and so on. If you add example, you will need the following

  1. add to TARGET
  2. add examples_*.hex target
sago35 commented 4 years ago

log:

$ gmake smoketest
tinygo build -size short -o examples_epd.hex -target=microbit            ./examples/epd
   code    data     bss |   flash     ram
   7860    1028    2276 |    8888    3304
76ba6bb3869b2f9025256a44e86f686c *examples_epd.hex
tinygo build -size short -o examples_hub75.hex -target=pybadge             ./examples/hub75
   code    data     bss |   flash     ram
  10604    8396    6444 |   19000   14840
c891ce351ec1eff2eb95e8d94ff1dccb *examples_hub75.hex
tinygo build -size short -o examples_pybadge.hex -target=pybadge             ./examples/pybadge
   code    data     bss |   flash     ram
  11400   32692    6364 |   44092   39056
3cd72c9cecd8fcec8b98e7223028c0b8 *examples_pybadge.hex
tinygo build -size short -o examples_pyportal.hex -target=pyportal            ./examples/pyportal
   code    data     bss |   flash     ram
  10680   32692    6348 |   43372   39040
7a8f40ebdc6993b1e69f36a091f16249 *examples_pyportal.hex
tinygo version
tinygo version 0.13.0 windows/amd64 (using go version go1.13.8 and LLVM version 10.0.1)
sago35 commented 4 years ago

benchmark: -j 1 vs -j 4 Core i7-7600U / 16GB / Windows 10 pro tinygo version 0.13.0 windows/amd64

$ time gmake smoketest
...
tinygo version 0.13.0 windows/amd64 (using go version go1.13.8 and LLVM version 10.0.1)

real    0m58.427s
user    0m0.000s
sys     0m0.015s
$ time gmake smoketest -j 4 --output-sync=target
...
tinygo version 0.13.0 windows/amd64 (using go version go1.13.8 and LLVM version 10.0.1)

real    0m40.138s
user    0m0.000s
sys     0m0.031s
deadprogram commented 4 years ago

Thanks @sago35 now merging.