forked from yatara-cc/z-butt-openscad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (40 loc) · 1.34 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
SHELL := /bin/bash
# SIZES := 1 1.25 1.5 1.75 2 2.25 2.75 3 4 6 6.25 7
SIZES := 1 2
STL_MX_MASTER_BASE := $(foreach xu,$(SIZES),stl/z-butt-$(xu)u-mx-master-base.stl)
STL_MX_SCULPT_BASE := $(foreach xu,$(SIZES),stl/z-butt-$(xu)u-mx-sculpt-base.stl)
STL_MX_STEM_CAVITY := $(foreach xu,$(SIZES),stl/z-butt-$(xu)u-mx-stem-cavity.stl)
STL_CONTAINER := $(foreach xu,$(SIZES),stl/z-butt-$(xu)u-container.stl)
all : \
img/z-butt-1u-2u-photo.png \
img/z-butt-family-photo.png \
$(STL_MX_MASTER_BASE) \
$(STL_MX_SCULPT_BASE) \
$(STL_MX_STEM_CAVITY) \
$(STL_CONTAINER)
clean :
rm -rf \
img/z-butt-1u-2u-photo.png \
img/z-butt-family-photo.png \
stl
stl/%.stl : %.scad z-butt.scad
@mkdir -p stl
openscad -o /tmp/$*.stl $<
mv /tmp/$*.stl $@
img/%.png : %.scad z-butt.scad
openscad \
--imgsize=870,870 \
-o /tmp/$*.png $<
mv /tmp/$*.png $@
z-butt-%u-mx-master-base.scad :
echo -e "include <z-butt.scad>\n\n\nmx_master_base(xu=$*);\n" > /tmp/$@
mv /tmp/$@ $@
z-butt-%u-mx-sculpt-base.scad :
echo -e "include <z-butt.scad>\n\n\nmx_sculpt_base(xu=$*);\n" > /tmp/$@
mv /tmp/$@ $@
z-butt-%u-mx-stem-cavity.scad :
echo -e "include <z-butt.scad>\n\n\nrotate([180, 0, 0]){mx_stem_cavity(xu=$*);}\n" > /tmp/$@
mv /tmp/$@ $@
z-butt-%u-container.scad :
echo -e "include <z-butt.scad>\n\n\nrotate([0, 0, 0]){container(xu=$*);}\n" > /tmp/$@
mv /tmp/$@ $@