From 98f4d3d694433071ac8cb0b747a3ebc6d6433646 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Thu, 6 Jul 2023 17:56:16 +0200 Subject: initial --- Makefile | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..39a3000 --- /dev/null +++ b/Makefile @@ -0,0 +1,43 @@ +SCAD=openscad + +STLOPTS= --export-format binstl +PNGOPTS= --colorscheme BeforeDawn --viewall --autocenter --imgsize 800,800 \ + --render + +STLDIR = stlout +PNGDIR = pngout + +SRC = $(wildcard *.scad) + +STL = $(addprefix $(STLDIR)/,$(SRC:.scad=.stl)) +PNG = $(addprefix $(PNGDIR)/,$(SRC:.scad=.png)) + +.PHONY: _default +_default: stl + +.PHONY: all +all: clean stl png + +.PHONY: stl +stl: $(STLDIR) $(STL) + +$(STLDIR)/%.stl: %.scad + @echo [ STL ] $< + @$(SCAD) $(STLOPTS) -o $@ $< + +png: $(PNGDIR) $(PNG) + +$(PNGDIR)/%.png: %.scad + @echo [ PNG ] $< + @$(SCAD) $(PNGOPTS) -o $@ $< + +$(PNGDIR): + @mkdir -p $(PNGDIR)/ + +$(STLDIR): + @mkdir -p $(STLDIR)/ + +.PHONY: clean +clean: + @rm -rf $(STLDIR)/ + @rm -rf $(PNGDIR)/ -- cgit v1.2.3