PARAMETERS := $(shell cat Lego.json | grep -v '"parameterSets": ""' | jq -r '.parameterSets | keys[]') STL = $(PARAMETERS:%=%.stl) SCAD = Lego.scad CONFIG = Lego.json all: $(STL) clean: rm -f $(STL) $(STL): $(SCAD) $(CONFIG) Makefile openscad -o $@ -p $(CONFIG) -P $(@:%.stl=%) $(SCAD)