aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 0e0c6a9c2420c8c1fad81629503be5784eb1b096 (plain)
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
56
57
58
59
60
SCAD=openscad

STLOPTS= --export-format binstl
PNGOPTS= --colorscheme BeforeDawn --viewall --autocenter --imgsize 800,800 \
	 --render

STLDIR = stlout
PNGDIR = pngout

SRC = $(wildcard *.scad)

STL = $(addprefix $(STLDIR)/,$(SRC:.scad=.stl))
PNG = $(addprefix $(PNGDIR)/,$(SRC:.scad=.png))

.PHONY: _default
_default: stl

.PHONY: all
all: clean stl png

.PHONY: stl
stl: $(STLDIR) $(STL)

$(STLDIR)/gridfinity.stl: gridfinity.scad
	@echo

$(STLDIR)/bitstorage_1x2.stl: bitstorage.scad
	@echo [ STL ] $<
	@$(SCAD) $(STLOPTS) -D ux=2 -o $@ $<

$(STLDIR)/bitstorage_1x1.stl: bitstorage.scad
	@echo [ STL ] $<
	@$(SCAD) $(STLOPTS) -D ux=1 -o $@ $<

$(STLDIR)/bitstorage.stl: $(STLDIR)/bitstorage_1x1.stl $(STLDIR)/bitstorage_1x2.stl
	@echo

$(STLDIR)/%.stl: %.scad
	@echo [ STL ] $<
	@$(SCAD) $(STLOPTS) -o $@ $<

png: $(PNGDIR) $(PNG)

$(PNGDIR)/gridfinity.png: gridfinity.scad
	@echo

$(PNGDIR)/%.png: %.scad
	@echo [ PNG ] $<
	@$(SCAD) $(PNGOPTS) -o $@ $<

$(PNGDIR):
	@mkdir -p $(PNGDIR)/

$(STLDIR):
	@mkdir -p $(STLDIR)/

.PHONY: clean
clean:
	@rm -rf $(STLDIR)/
	@rm -rf $(PNGDIR)/