|
diff --git a/Makefile b/Makefile index 5753a68..b9d2b4c 100644 --- a/ Makefile+++ b/ Makefile |
|
@@ -1,44 +1,46 @@ |
1 | -include Makefile.local |
1 | -include Makefile.local |
2 | |
2 | |
3 | OPENSCAD_APP?=/Applications/OpenSCAD.app |
3 | OPENSCAD_APP?=/Applications/OpenSCAD.app |
4 | OPENSCAD_BIN?=${OPENSCAD_APP}/Contents/MacOS/OpenSCAD |
4 | OPENSCAD_BIN?=${OPENSCAD_APP}/Contents/MacOS/OpenSCAD |
5 | OPENSCAD_FLAGS=-D draft=false -D debug=false |
5 | OPENSCAD_FLAGS=-D draft=false -D debug=false |
6 | SED?=sed |
6 | SED?=sed |
7 | ECHO?=/bin/echo |
7 | ECHO?=/bin/echo |
8 | AWK?=awk |
8 | AWK?=awk |
9 | |
9 | |
10 | default: |
10 | default: |
11 | @echo "And?" |
11 | @echo "And?" |
12 | |
12 | |
13 | clean: |
13 | clean: |
14 | rm -f *.stl *.gcode |
14 | rm -f *.stl *.gcode |
15 | |
15 | |
16 | stl-another-%: |
16 | stl-another-%: |
17 | $(MAKE) another-$*-{body,body-label,lever,knob,knob-label,springpad}.stl |
17 | $(MAKE) another-$*-{body,body-label,body-scale,lever,knob,knob-label,springpad}.stl |
18 | |
18 | |
19 | another-%-body.stl: another-%.scad another.scad |
19 | another-%-body.stl: another-%.scad another.scad |
20 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="body"' -o "$@" "$<" |
20 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="body"' -o "$@" "$<" |
21 | another-%-body-label.stl: another-%.scad another.scad |
21 | another-%-body-label.stl: another-%.scad another.scad |
22 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="body.label"' -o "$@" "$<" |
22 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="body.label"' -o "$@" "$<" |
| |
23 | another-%-body-scale.stl: another-%.scad another.scad |
| |
24 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="body.scale"' -o "$@" "$<" |
23 | another-%-lever.stl: another-%.scad another.scad |
25 | another-%-lever.stl: another-%.scad another.scad |
24 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="lever"' -o "$@" "$<" |
26 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="lever"' -o "$@" "$<" |
25 | another-%-knob.stl: another-%.scad another.scad |
27 | another-%-knob.stl: another-%.scad another.scad |
26 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="knob"' -o "$@" "$<" |
28 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="knob"' -o "$@" "$<" |
27 | another-%-knob-label.stl: another-%.scad another.scad |
29 | another-%-knob-label.stl: another-%.scad another.scad |
28 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="knob.label"' -o "$@" "$<" |
30 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="knob.label"' -o "$@" "$<" |
29 | another-%-springpad.stl: another-%.scad another.scad |
31 | another-%-springpad.stl: another-%.scad another.scad |
30 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="springpad"' -o "$@" "$<" |
32 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="springpad"' -o "$@" "$<" |
31 | |
33 | |
32 | multiswitch: multiswitch.c8r.scad $(addsuffix .stl,$(addprefix multiswitch-embeddest-,2 3 4 5 6)) |
34 | multiswitch: multiswitch.c8r.scad $(addsuffix .stl,$(addprefix multiswitch-embeddest-,2 3 4 5 6)) |
33 | multiswitch-embeddest-%.stl: multiswitch-embeddest.scad |
35 | multiswitch-embeddest-%.stl: multiswitch-embeddest.scad |
34 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D inputs=$* -o "$@" "$<" |
36 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D inputs=$* -o "$@" "$<" |
35 | |
37 | |
36 | multiswitch.c8r.scad: multiswitch-c8r.scad threads.scad pushfit_data.scad pushfittery.scad multiswitch.scad |
38 | multiswitch.c8r.scad: multiswitch-c8r.scad threads.scad pushfit_data.scad pushfittery.scad multiswitch.scad |
37 | @echo "Preprocessing into $@…" |
39 | @echo "Preprocessing into $@…" |
38 | @( \ |
40 | @( \ |
39 | $(ECHO) "/* DO NOT. JUST DO NOT. FORGET THIS FILE, IT'S PREPROCESSED, GET THE SOURCE. */" ;\ |
41 | $(ECHO) "/* DO NOT. JUST DO NOT. FORGET THIS FILE, IT'S PREPROCESSED, GET THE SOURCE. */" ;\ |
40 | $(AWK) '/^\/\/CUSTOMIZERCUTOFF/ {nextfile} {print}' $^ | $(SED) -Ee 's,^(use|include),//\1,g' \ |
42 | $(AWK) '/^\/\/CUSTOMIZERCUTOFF/ {nextfile} {print}' $^ | $(SED) -Ee 's,^(use|include),//\1,g' \ |
41 | ) > $@ |
43 | ) > $@ |
42 | |
44 | |
43 | %.stl: %.scad |
45 | %.stl: %.scad |
44 | ${OPENSCAD_BIN} ${OPENSCAD_FLAGS} -o "$@" "$<" |
46 | ${OPENSCAD_BIN} ${OPENSCAD_FLAGS} -o "$@" "$<" |
|