-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
55 lines (40 loc) · 1.29 KB
/
Copy pathmakefile
File metadata and controls
55 lines (40 loc) · 1.29 KB
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
54
55
#Produce a build of all .scad files
#By default we will assume openscad is on PATH
OPENSCAD:=openscad
OBJ_DIR:=out
60mm_dir:=./60mm
120mm_dir:=./120mm
60mm_src:=top.scad \
flow-conditioner.scad \
flow-conditioner-gap.scad \
filter-housing.scad
60mm_stl:=$(patsubst %.scad, $(OBJ_DIR)/60mm/%.stl, $(60mm_src))
60mm_src:=$(patsubst %, $(60mm_dir)/%, $(60mm_src))
#If we passed an openscad executable using an environment variable, use it
ifneq "$$openscad" ""
OPENSCAD:=$$openscad
endif
release:
if [[ $$(git diff-index HEAD) == "" ]]; then \
$(MAKE) clean; \
zip -r release-$$(git rev-parse --short HEAD) out; \
else \
echo "There are uncommitted changes, please commit your work before preparing a release"; \
fi
#we explicitly set root.scad as a prerequisite so the entire project will be rebuilt if it gets modified
out/60mm/%.stl : 60mm/%.scad 60mm/root.scad
$(OPENSCAD) $< -D "resolution = resolutionProd" -o $@
$(OBJ_DIR)/60mm:
mkdir -pv $(OBJ_DIR)/60mm
$(OBJ_DIR): $(OBJ_DIR)/60mm
mkdir -pv $@
$(OBJ_DIR)/60mm/instructions.txt: 60mm/instructions.txt
cp -f $< $@
$(OBJ_DIR)/60mm/src.tar.gz: $(60mm_dir)/*.scad
tar -czf $@ $<
60mm: $(OBJ_DIR) $(60mm_stl) $(60mm_src) $(OBJ_DIR)/60mm/instructions.txt $(OBJ_DIR)/60mm/src.tar.gz
all:
$(MAKE) 60mm
clean:
rm -rf out
$(MAKE) 60mm