-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (40 loc) · 1.13 KB
/
Copy pathMakefile
File metadata and controls
50 lines (40 loc) · 1.13 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
OPENSCAD ?= openscad
SCAD = 10InchRackGenerator.scad
RENDERS = tests/renders
IMGSIZE ?= 2560,1440
COLORSCHEME = Tomorrow Night
# Optional: make test TEST=missing_air_holes
ifdef TEST
BATS_FILTER = --filter "$(TEST)"
endif
.PHONY: all test test-stl test-all preview clean
all: test
# Fast preview tests — run all, or filter with TEST=<name>.
# When TEST is set, RENDER_STL=1 is passed so render_views also produces an STL.
ifdef TEST
test:
IMGSIZE=$(IMGSIZE) RENDER_STL=1 bats $(BATS_FILTER) tests/rack.bats
else
test:
IMGSIZE=$(IMGSIZE) bats tests/rack.bats
endif
# Full CGAL geometry validation — slow (~35s per case)
test-stl:
IMGSIZE=$(IMGSIZE) bats $(BATS_FILTER) tests/rack_stl.bats
# Everything
test-all:
IMGSIZE=$(IMGSIZE) bats $(BATS_FILTER) tests/rack.bats tests/rack_stl.bats
# Quick default-param preview PNG
preview: $(RENDERS)/preview.png
$(RENDERS)/preview.png: $(SCAD) | $(RENDERS)
$(OPENSCAD) -o $@ \
--imgsize=$(IMGSIZE) \
--camera=0,0,0,55,0,25,1 \
--autocenter --viewall \
--colorscheme="$(COLORSCHEME)" \
$<
$(RENDERS):
mkdir -p $(RENDERS)
clean:
rm -rf $(RENDERS)
rm -f preview.png