aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2023-01-24 16:38:30 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2023-01-24 16:38:30 +0100
commite962c204f3949829614c8445c5c93150e615607f (patch)
tree5d83b7f8d02f45876d7999979cadb31ca260baac
parentf2074c15ceb9e3a4511343fd2d2738cda804691e (diff)
downloadoscad_gridfinity-e962c204f3949829614c8445c5c93150e615607f.tar.gz
better multibuild
-rw-r--r--Makefile18
1 files changed, 10 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 0e0c6a9..d98cc5f 100644
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,9 @@ SRC = $(wildcard *.scad)
STL = $(addprefix $(STLDIR)/,$(SRC:.scad=.stl))
PNG = $(addprefix $(PNGDIR)/,$(SRC:.scad=.png))
+BITSTORAGE_SIZES = $(STLDIR)/bitstorage_1x1x6.35.stl $(STLDIR)/bitstorage_1x2x6.35.stl $(STLDIR)/bitstorage_2x2x6.35.stl \
+ $(STLDIR)/bitstorage_1x1x4.stl $(STLDIR)/bitstorage_1x2x4.stl $(STLDIR)/bitstorage_2x2x4.stl
+
.PHONY: _default
_default: stl
@@ -24,15 +27,14 @@ stl: $(STLDIR) $(STL)
$(STLDIR)/gridfinity.stl: gridfinity.scad
@echo
-$(STLDIR)/bitstorage_1x2.stl: bitstorage.scad
- @echo [ STL ] $<
- @$(SCAD) $(STLOPTS) -D ux=2 -o $@ $<
-
-$(STLDIR)/bitstorage_1x1.stl: bitstorage.scad
- @echo [ STL ] $<
- @$(SCAD) $(STLOPTS) -D ux=1 -o $@ $<
+$(STLDIR)/bitstorage_%.stl: bitstorage.scad
+ @echo [ STL ] $< $*
+ @$(SCAD) $(STLOPTS) \
+ -D ux=$(firstword $(subst x, ,$*)) -D uy=$(word 2,$(subst x, ,$*)) \
+ -D wrench_size=$(word 3,$(subst x, ,$*))\
+ -o $@ $<
-$(STLDIR)/bitstorage.stl: $(STLDIR)/bitstorage_1x1.stl $(STLDIR)/bitstorage_1x2.stl
+$(STLDIR)/bitstorage.stl: $(BITSTORAGE_SIZES)
@echo
$(STLDIR)/%.stl: %.scad