add make all target

This commit is contained in:
deboxed 2026-02-05 11:45:31 +01:00
commit 87b6a11a30
2 changed files with 12 additions and 5 deletions

View file

@ -1,6 +1,4 @@
# TARGETS=$(shell sed '/^module [a-z0-9_-]*().*make..\?me.*$$/!d;s/module //;s/().*/.stl/' main.scad)
TARGETS=$(shell python3 get_targets.py main.json)
GENERATED_FILES = $(wildcard *.deps) \
$(wildcard *.stl) \
@ -9,14 +7,14 @@ GENERATED_FILES = $(wildcard *.deps) \
.phony: all clean
# all: ${TARGETS}
all: ${TARGETS}
include $(wildcard *.deps)
%.stl: main.scad main.json Makefile
flatpak run org.openscad.OpenSCAD --enable textmetrics -p main.json -P $(basename $@) -DFN=64 -D "MODELVER=\"$(shell git rev-parse --short=6 HEAD)\"" -m make -o $@ -d $@.deps $<
%.png:
%.png: main.scad main.json Makefile
flatpak run org.openscad.OpenSCAD --enable textmetrics -p main.json -P $(basename $@) -DFN=32 --render --imgsize 1600,1200 -o $@ main.scad
clean:

9
get_targets.py Normal file
View file

@ -0,0 +1,9 @@
import json
import sys
with open(sys.argv[1]) as f:
d = json.load(f)
sets=[]
for set in d['parameterSets']:
sets.append(set + '.stl')
print(' '.join(sets))