diff --git a/Makefile b/Makefile index 1317654..20c28f9 100644 --- a/Makefile +++ b/Makefile @@ -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: diff --git a/get_targets.py b/get_targets.py new file mode 100644 index 0000000..3474616 --- /dev/null +++ b/get_targets.py @@ -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))