Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jinhwanlazy/681e579e01aa2663b2920e3e4456f26f to your computer and use it in GitHub Desktop.
Save jinhwanlazy/681e579e01aa2663b2920e3e4456f26f to your computer and use it in GitHub Desktop.
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