Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
barebone makefile for openscad
BUILDDIR = build
SRCDIR = src
OPENSCAD:=$(shell type -p openscad || echo /Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD)
VPATH = $(SRCDIR):$(BUILDDIR)
STL_TARGETS = $(patsubst $(SRCDIR)/%.scad,$(BUILDDIR)/%.stl,$(wildcard $(SRCDIR)/*.scad))
.PHONY: all clean
all: $(STL_TARGETS)
$(BUILDDIR)/%.stl: %.scad
mkdir -p ${BUILDDIR}
${OPENSCAD} -o $@ $<
clean:
rm -f ${BUILDDIR}/*.stl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment