aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2023-07-06 17:56:16 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2023-07-06 17:56:16 +0200
commit98f4d3d694433071ac8cb0b747a3ebc6d6433646 (patch)
tree73acac001526a577411b2a9a41e29709d6283ad9 /Makefile
downloadwebcam_fmount-98f4d3d694433071ac8cb0b747a3ebc6d6433646.tar.gz
initial
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile43
1 files changed, 43 insertions, 0 deletions
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)/