Makefile 1.1 KB

123456789101112131415161718192021222324252627
  1. ROOT ?= $(realpath $(CURDIR)/../..)
  2. PROJECTS ?= $(wildcard ../../examples/stm32/nucleo-*-cube-*)
  3. TARGET ?= Debug
  4. DOCKER = docker run --rm -v $(ROOT):$(ROOT) -v $(CURDIR):/root -w $(CURDIR)
  5. IMAGE ?= springrockconsulting/stm32cubeide:v1
  6. # image author did not set path, so a hardcoded reference to a variable name dir is needed
  7. PATHTO ?= /opt/st/stm32cubeide_1.12.0/
  8. all: $(PROJECTS)
  9. $(DOCKER) $(IMAGE) $(PATHTO)headless-build.sh -data workspace -removeAll workspace
  10. $(PROJECTS): FORCE
  11. $(DOCKER) $(IMAGE) $(PATHTO)headless-build.sh -data workspace -import $@ -cleanBuild $(@F)/$(TARGET)
  12. FORCE:
  13. # Automated remote test. See https://vcon.io/automated-firmware-tests/
  14. URL ?= https://dash.vcon.io/api/v3/devices
  15. update: $(PROJECTS)
  16. curl --fail-with-body -su :$(VCON_API_KEY) $(URL)/$(DEVICE)/ota --data-binary @$</$(TARGET)/firmware.bin
  17. test update: TARGET = Test
  18. test: update
  19. curl --fail-with-body -su :$(VCON_API_KEY) $(URL)/$(DEVICE)/tx?t=5 | tee /tmp/output.txt
  20. grep 'READY, IP:' /tmp/output.txt # Check for network init
  21. # grep 'MQTT connected' /tmp/output.txt # Check for MQTT connection success