aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2023-01-15 22:01:15 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2023-01-15 22:01:15 +0100
commit8c74737fcf2029787380b94f69daaf6aa049a3b4 (patch)
tree61bd987292011c1f261c34aca8d11df28417b67f /Makefile
parent1b003081b689d0f999e6123cc330bb94d6aa6662 (diff)
downloadoscad_gridfinity-8c74737fcf2029787380b94f69daaf6aa049a3b4.tar.gz
Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile38
1 files changed, 25 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index a47a419..2c2899e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,37 +1,49 @@
SCAD=openscad
STLOPTS= --export-format binstl
-PNGOPTS= --viewall --autocenter --imgsize 400,400 --render
+PNGOPTS= --colorscheme BeforeDawn --viewall --autocenter --imgsize 800,800 \
+ --render
+
+STLDIR = stlout
+PNGDIR = pngout
SRC = $(wildcard *.scad)
-STL = $(SRC:.scad=.stl)
-PNG = $(SRC:.scad=.png)
+STL = $(addprefix $(STLDIR)/,$(SRC:.scad=.stl))
+PNG = $(addprefix $(PNGDIR)/,$(SRC:.scad=.png))
+.PHONY: _default
_default: stl
+.PHONY: all
all: clean stl png
-stl: $(STL)
+.PHONY: stl
+stl: $(STLDIR) $(STL)
-gridfinity.stl: gridfinity.scad
+$(STLDIR)/gridfinity.stl: gridfinity.scad
@echo
-%.stl: %.scad
+$(STLDIR)/%.stl: %.scad
@echo [ STL ] $<
@$(SCAD) $(STLOPTS) -o $@ $<
+png: $(PNGDIR) $(PNG)
-png: $(PNG)
-
-gridfinity.png: gridfinity.scad
+$(PNGDIR)/gridfinity.png: gridfinity.scad
@echo
-%.png: %.scad
+$(PNGDIR)/%.png: %.scad
@echo [ PNG ] $<
- @$(SCAD) $(SCADOPTS) -o $@ $<
+ @$(SCAD) $(PNGOPTS) -o $@ $<
+
+$(PNGDIR):
+ @mkdir -p $(PNGDIR)/
+
+$(STLDIR):
+ @mkdir -p $(STLDIR)/
.PHONY: clean
clean:
- @rm -f *.stl
- @rm -f *.png
+ @rm -rf $(STLDIR)/
+ @rm -rf $(PNGDIR)/