2023-04-07 04:33:45 +08:00
|
|
|
ROOT ?= $(realpath $(CURDIR)/../..)
|
2023-06-19 22:08:34 +08:00
|
|
|
PROJECTS ?= $(wildcard ../../examples/stm32/nucleo-*-cube-*)
|
|
|
|
TARGET ?= Debug
|
2023-04-07 04:33:45 +08:00
|
|
|
DOCKER = docker run --rm -v $(ROOT):$(ROOT) -v $(CURDIR):/root -w $(CURDIR)
|
2024-09-27 06:02:32 +08:00
|
|
|
IMAGE ?= scaprile/cubeozone
|
|
|
|
# set PATHTO if image author did not set path
|
2023-04-07 04:33:45 +08:00
|
|
|
|
|
|
|
all: $(PROJECTS)
|
2023-08-05 02:37:57 +08:00
|
|
|
$(DOCKER) $(IMAGE) $(PATHTO)headless-build.sh -data workspace -removeAll workspace
|
2023-04-07 04:33:45 +08:00
|
|
|
|
|
|
|
$(PROJECTS): FORCE
|
2024-10-04 22:53:56 +08:00
|
|
|
(make -C $@ && make -C $@ clean) || ( \
|
2024-10-04 22:53:56 +08:00
|
|
|
COREDIRS=`find $@ -maxdepth 1 -name 'CM*' -print` && ( \
|
|
|
|
(test "$$COREDIRS" == "" && \
|
|
|
|
PROJNAME=`xq -r .projectDescription.name $@/.project` && \
|
|
|
|
$(DOCKER) $(IMAGE) $(PATHTO)headless-build.sh -data workspace -import $@ -cleanBuild $$PROJNAME/$(TARGET) ) || ( \
|
|
|
|
(test "$$COREDIRS" != "" && \
|
|
|
|
for core in $$COREDIRS; do \
|
|
|
|
DIR=`basename $$core` \
|
|
|
|
PROJNAME=`xq -r .projectDescription.name $@/$$DIR/.project` && \
|
|
|
|
$(DOCKER) $(IMAGE) $(PATHTO)headless-build.sh -data workspace -import $@/$$DIR -cleanBuild $$PROJNAME/$(TARGET) || exit 1; \
|
|
|
|
done ))))
|
2023-04-07 04:33:45 +08:00
|
|
|
|
|
|
|
FORCE:
|