chiark / gitweb /
2e4f2f1ad3980aa2cea64861df26b351956fd81d
[scad] / Makefile
1 ### -*-makefile-gmake-*-
2 ###
3 ### Build OpenSCAD models
4 ###
5 ### (c) 2022 Mark Wooding
6 ###
7
8 ###----- Licensing notice ---------------------------------------------------
9 ###
10 ### This program is free software: you can redistribute it and/or modify
11 ### it under the terms of the GNU General Public License as published by
12 ### the Free Software Foundation; either version 3 of the License, or (at
13 ### your option) any later version.
14 ###
15 ### This program is distributed in the hope that it will be useful, but
16 ### WITHOUT ANY WARRANTY; without even the implied warranty of
17 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 ### General Public License for more details.
19 ###
20 ### You should have received a copy of the GNU General Public License
21 ### along with this program.  If not, see <https://www.gnu.org/licenses/>.
22
23 all:
24
25 ## `Silent-rules' machinery.
26 V                        = 0
27 V_AT                     = $(V_AT).$V
28 V_AT.0                   = @
29 v-tag                    = $(call v-tag.$V,$1)
30 v-tag.0                  = @printf "  %-8s %s\n" "$1" "$@";
31
32 ## Other configuration.
33 OPENSCAD                 = openscad
34
35 ## Main list of models.
36 MODELS                  += discpick-collar.scad
37
38 ## Building models.
39 CLEANFILES              += *.stl
40 %.stl: %.scad
41         $(call v-tag,SCAD)$(OPENSCAD) -o$@ -d$*.dep $<
42 STLS                     = $(MODELS:.scad=.stl)
43 all: $(STLS)
44
45 ## Dependency file management.
46 CLEANFILES              += *.dep
47 DEPS                    += $(MODELS:.scad=.dep)
48 -include $(DEPS)
49
50 ## Cleaning up.
51 clean:; rm -f $(CLEANFILES)
52
53 ###----- That's all, folks --------------------------------------------------