-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
71 lines (55 loc) · 2.24 KB
/
Makefile
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
61
62
63
64
65
66
67
68
69
70
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
OPENSCAD:=/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD
endif
ifneq ($(UNAME), Darwin)
OPENSCAD:=$(shell which openscad)
endif
BUILDDIR=./build
#_PARTS = pulley bar-clamp belt-clamp coupling endstop-holder frame-vertex pla-bushing prusalogo rod-clamp x-carriage x-end-idler x-end-motor y-slider-better z-motor-mount
### prusalogo.scad depends on bitmap.scad
_PARTS = pulley bar-clamp belt-clamp coupling endstop-holder vertex pla-bushing prusalogo rod-clamp x-carriage x-end-idler x-end-motor y-slider-better z-motor-mount
PARTS = $(patsubst %,$(BUILDDIR)/%.stl,$(_PARTS))
.PHONY : usage all clean _PARTS MakerbotPlates MendelPlate
default : usage
usage :
@echo "Usage 'make parts'"
@echo " make parts MakerbotPlates"
@echo " make parts MendelPlate"
@echo " make OPENSCAD=\`which openscad\` parts MakerbotPlates"
@echo "Variable Values:"
@echo " BUILDDIR = $(BUILDDIR)"
@echo " OPENSCAD = $(OPENSCAD)"
@echo " PARTS = $(PARTS)"
@echo " UNAME = $(UNAME)"
all : parts MakerbotPlates
parts : $(PARTS)
$(BUILDDIR) :
mkdir -p $(BUILDDIR)
MakerbotPlates : parts
cp makerbot.scad $(BUILDDIR)
# cp prusalogo.stl $(BUILDDIR)
cp y-motor-bracket_1off.stl $(BUILDDIR)
cp z-bar-top-clamp_4off.stl $(BUILDDIR)
$(OPENSCAD) -D render_plate=1 -s $(BUILDDIR)/mbplate1.stl $(BUILDDIR)/makerbot.scad
$(OPENSCAD) -D render_plate=2 -s $(BUILDDIR)/mbplate2.stl $(BUILDDIR)/makerbot.scad
$(OPENSCAD) -D render_plate=3 -s $(BUILDDIR)/mbplate3.stl $(BUILDDIR)/makerbot.scad
$(OPENSCAD) -D render_plate=4 -s $(BUILDDIR)/mbplate4.stl $(BUILDDIR)/makerbot.scad
$(OPENSCAD) -D render_plate=5 -s $(BUILDDIR)/mbplate5.stl $(BUILDDIR)/makerbot.scad
MendelPlate : parts
cp plate1.scad $(BUILDDIR)
# cp prusalogo.stl $(BUILDDIR)
cp y-motor-bracket_1off.stl $(BUILDDIR)
cp z-bar-top-clamp_4off.stl $(BUILDDIR)
$(OPENSCAD) -s $(BUILDDIR)/plate1.stl $(BUILDDIR)/plate1.scad
$(_PARTS) :
$(MAKE) $(BUILDDIR)/[email protected]
$(BUILDDIR)/%.stl : $(BUILDDIR) %.scad
@echo "Processing $*"
$(OPENSCAD) -s $(BUILDDIR)/$*.stl $*.scad
$(BUILDDIR)/pulley.stl : $(BUILDDIR)
@echo "Fetching nophead's pulley.stl..."
wget http://www.thingiverse.com/download:5914 -O $(BUILDDIR)/pulley.stl
touch $(BUILDDIR)/pulley.stl
clean :
$(RM) -rf $(BUILDDIR)