diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2023-01-15 22:01:15 +0100 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2023-01-15 22:01:15 +0100 |
commit | 8c74737fcf2029787380b94f69daaf6aa049a3b4 (patch) | |
tree | 61bd987292011c1f261c34aca8d11df28417b67f /Makefile | |
parent | 1b003081b689d0f999e6123cc330bb94d6aa6662 (diff) | |
download | oscad_gridfinity-8c74737fcf2029787380b94f69daaf6aa049a3b4.tar.gz |
Makefile
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 38 |
1 files changed, 25 insertions, 13 deletions
@@ -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)/ |