forked from rwb27/openflexure_microscope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
164 lines (111 loc) · 8.74 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# Makefile for the openflexure microscope
# Generated by generate_makefile.py
.PHONY: all cleanstl
SOURCE = openscad
OUTPUT = builds
body_versions = SS40 SS40-M LS65 LS65-M LS75 LS75-M
optics_versions = picamera_2_pilens_SS40 logitech_c270_c270_lens_SS40 picamera_2_rms_f40d16_LS65 picamera_2_rms_f50d13_LS65 logitech_c270_rms_f40d16_LS65 logitech_c270_rms_f50d13_LS65 m12_rms_f40d16_LS65 m12_rms_f50d13_LS65 m12_m12_lens_LS65
illumination_versions = SS40 SS40_tall SS40_condenser SS40_condenser_tall LS65 LS65_tall LS65_condenser LS65_condenser_tall LS75 LS75_tall LS75_condenser LS75_condenser_tall
sample_riser_versions = LS10 LS5 SS5
slide_riser_versions = LS10
TOOLS := actuator_assembly_tools condenser_lens_tool tube_lens_tool
TOOLS := $(TOOLS) picamera_2_cover picamera_2_gripper picamera_2_lens_gripper
ACCESSORIES := picamera_2_cover $(sample_riser_versions:%=sample_riser_%) $(slide_riser_versions:%=slide_riser_%)
COMMONPARTS := feet feet_tall gears sample_clips small_gears
BODIES := $(body_versions:%=main_body_%)
OPTICS := $(optics_versions:%=optics_%)
ILLUMINATIONS := $(illumination_versions:%=illumination_and_rear_foot_%)
ALLPARTS := $(COMMONPARTS) $(TOOLS) $(BODIES) $(ILLUMINATIONS) $(OPTICS) $(ACCESSORIES)
ALLSTLFILES := $(ALLPARTS:%=$(OUTPUT)/%.stl)
parameters_file := $(SOURCE)/microscope_parameters.scad
utilities_file := $(SOURCE)/utilities.scad
all_deps := $(parameters_file) $(utilities_file) #All targets depend on these
all: $(ALLSTLFILES)
cleanstl:
rm -f $(ALLSTLFILES)
#parameter and utilities files affect everything
$(OUTPUT)/%.stl: $(all_deps)
main_body_dep_names := compact_nut_seat dovetail logo
main_body_deps := $(main_body_dep_names:%=$(SOURCE)/%.scad)
$(OUTPUT)/main_body_SS40.stl: $(SOURCE)/main_body.scad $(main_body_deps)
openscad -o $@ -D 'big_stage=false' -D 'sample_z=40' -D 'motor_lugs=false' $<
$(OUTPUT)/main_body_SS40-M.stl: $(SOURCE)/main_body.scad $(main_body_deps)
openscad -o $@ -D 'big_stage=false' -D 'sample_z=40' -D 'motor_lugs=true' $<
$(OUTPUT)/main_body_LS65.stl: $(SOURCE)/main_body.scad $(main_body_deps)
openscad -o $@ -D 'big_stage=true' -D 'sample_z=65' -D 'motor_lugs=false' $<
$(OUTPUT)/main_body_LS65-M.stl: $(SOURCE)/main_body.scad $(main_body_deps)
openscad -o $@ -D 'big_stage=true' -D 'sample_z=65' -D 'motor_lugs=true' $<
$(OUTPUT)/main_body_LS75.stl: $(SOURCE)/main_body.scad $(main_body_deps)
openscad -o $@ -D 'big_stage=true' -D 'sample_z=75' -D 'motor_lugs=false' $<
$(OUTPUT)/main_body_LS75-M.stl: $(SOURCE)/main_body.scad $(main_body_deps)
openscad -o $@ -D 'big_stage=true' -D 'sample_z=75' -D 'motor_lugs=true' $<
illumination_dep_names := dovetail optics
illumination_deps := $(illumination_dep_names:%=$(SOURCE)/%.scad)
$(OUTPUT)/illumination_and_rear_foot_SS40.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D 'big_stage=false' -D 'condenser=false' -D 'sample_z=40' -D 'motor_lugs=false' $<
$(OUTPUT)/illumination_and_rear_foot_SS40_tall.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D 'big_stage=false' -D 'motor_lugs=false' -D 'condenser=false' -D 'sample_z=40' -D 'foot_height=26' $<
$(OUTPUT)/illumination_and_rear_foot_SS40_condenser.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D 'big_stage=false' -D 'condenser=true' -D 'sample_z=40' -D 'motor_lugs=false' $<
$(OUTPUT)/illumination_and_rear_foot_SS40_condenser_tall.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D 'big_stage=false' -D 'motor_lugs=false' -D 'condenser=true' -D 'sample_z=40' -D 'foot_height=26' $<
$(OUTPUT)/illumination_and_rear_foot_LS65.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D 'big_stage=true' -D 'condenser=false' -D 'sample_z=65' -D 'motor_lugs=false' $<
$(OUTPUT)/illumination_and_rear_foot_LS65_tall.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D 'big_stage=true' -D 'motor_lugs=false' -D 'condenser=false' -D 'sample_z=65' -D 'foot_height=26' $<
$(OUTPUT)/illumination_and_rear_foot_LS65_condenser.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D 'big_stage=true' -D 'condenser=true' -D 'sample_z=65' -D 'motor_lugs=false' $<
$(OUTPUT)/illumination_and_rear_foot_LS65_condenser_tall.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D 'big_stage=true' -D 'motor_lugs=false' -D 'condenser=true' -D 'sample_z=65' -D 'foot_height=26' $<
$(OUTPUT)/illumination_and_rear_foot_LS75.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D 'big_stage=true' -D 'condenser=false' -D 'sample_z=75' -D 'motor_lugs=false' $<
$(OUTPUT)/illumination_and_rear_foot_LS75_tall.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D 'big_stage=true' -D 'motor_lugs=false' -D 'condenser=false' -D 'sample_z=75' -D 'foot_height=26' $<
$(OUTPUT)/illumination_and_rear_foot_LS75_condenser.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D 'big_stage=true' -D 'condenser=true' -D 'sample_z=75' -D 'motor_lugs=false' $<
$(OUTPUT)/illumination_and_rear_foot_LS75_condenser_tall.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D 'big_stage=true' -D 'motor_lugs=false' -D 'condenser=true' -D 'sample_z=75' -D 'foot_height=26' $<
optics_dep_names := dovetail cameras/camera
optics_deps := $(optics_dep_names:%=$(SOURCE)/%.scad)
$(OUTPUT)/optics_picamera_2_pilens_SS40.stl: $(SOURCE)/optics.scad $(optics_deps)
openscad -o $@ -D 'optics="pilens"' -D 'camera="picamera_2"' -D 'big_stage=false' -D 'sample_z=40' -D 'motor_lugs=false' $<
$(OUTPUT)/optics_logitech_c270_c270_lens_SS40.stl: $(SOURCE)/optics.scad $(optics_deps)
openscad -o $@ -D 'optics="c270_lens"' -D 'camera="logitech_c270"' -D 'big_stage=false' -D 'sample_z=40' -D 'motor_lugs=false' $<
$(OUTPUT)/optics_picamera_2_rms_f40d16_LS65.stl: $(SOURCE)/optics.scad $(optics_deps)
openscad -o $@ -D 'optics="rms_f40d16"' -D 'camera="picamera_2"' -D 'big_stage=true' -D 'sample_z=65' -D 'motor_lugs=false' $<
$(OUTPUT)/optics_picamera_2_rms_f50d13_LS65.stl: $(SOURCE)/optics.scad $(optics_deps)
openscad -o $@ -D 'optics="rms_f50d13"' -D 'camera="picamera_2"' -D 'big_stage=true' -D 'sample_z=65' -D 'motor_lugs=false' $<
$(OUTPUT)/optics_logitech_c270_rms_f40d16_LS65.stl: $(SOURCE)/optics.scad $(optics_deps)
openscad -o $@ -D 'optics="rms_f40d16"' -D 'camera="logitech_c270"' -D 'big_stage=true' -D 'sample_z=65' -D 'motor_lugs=false' $<
$(OUTPUT)/optics_logitech_c270_rms_f50d13_LS65.stl: $(SOURCE)/optics.scad $(optics_deps)
openscad -o $@ -D 'optics="rms_f50d13"' -D 'camera="logitech_c270"' -D 'big_stage=true' -D 'sample_z=65' -D 'motor_lugs=false' $<
$(OUTPUT)/optics_m12_rms_f40d16_LS65.stl: $(SOURCE)/optics.scad $(optics_deps)
openscad -o $@ -D 'optics="rms_f40d16"' -D 'camera="m12"' -D 'big_stage=true' -D 'sample_z=65' -D 'motor_lugs=false' $<
$(OUTPUT)/optics_m12_rms_f50d13_LS65.stl: $(SOURCE)/optics.scad $(optics_deps)
openscad -o $@ -D 'optics="rms_f50d13"' -D 'camera="m12"' -D 'big_stage=true' -D 'sample_z=65' -D 'motor_lugs=false' $<
$(OUTPUT)/optics_m12_m12_lens_LS65.stl: $(SOURCE)/optics.scad $(optics_deps)
openscad -o $@ -D 'optics="m12_lens"' -D 'camera="m12"' -D 'big_stage=true' -D 'sample_z=65' -D 'motor_lugs=false' $<
riser_dep_names := main_body
riser_deps := $(optics_dep_names:%=$(SOURCE)/%.scad)
$(OUTPUT)/sample_riser_LS10.stl: $(SOURCE)/sample_riser.scad $(riser_deps)
openscad -o $@ -D 'h=10' -D 'big_stage=true' $<
$(OUTPUT)/sample_riser_LS5.stl: $(SOURCE)/sample_riser.scad $(riser_deps)
openscad -o $@ -D 'h=5' -D 'big_stage=true' $<
$(OUTPUT)/sample_riser_SS5.stl: $(SOURCE)/sample_riser.scad $(riser_deps)
openscad -o $@ -D 'h=5' -D 'big_stage=false' $<
$(OUTPUT)/slide_riser_LS10.stl: $(SOURCE)/slide_riser.scad $(riser_deps)
openscad -o $@ -D 'h=10' -D 'big_stage=true' $<
stand_dep_names := main_body
stand_deps := $(optics_dep_names:%=$(SOURCE)/%.scad)
$(OUTPUT)/microscope_stand_LS65-20.stl: $(SOURCE)/microscope_stand.scad $(stand_deps)
openscad -o $@ -D 'h=20' -D 'big_stage=true' -D 'sample_z=65' -D 'motor_lugs=false' $<
$(OUTPUT)/microscope_stand_LS65-160.stl: $(SOURCE)/microscope_stand.scad $(stand_deps)
openscad -o $@ -D 'h=160' -D 'big_stage=true' -D 'sample_z=65' -D 'motor_lugs=false' $<
$(OUTPUT)/microscope_stand_SS40-20.stl: $(SOURCE)/microscope_stand.scad $(stand_deps)
openscad -o $@ -D 'h=20' -D 'big_stage=false' -D 'sample_z=40' -D 'motor_lugs=false' $<
$(OUTPUT)/picamera_2_%.stl: $(SOURCE)/cameras/picamera_2_%.scad $(all_deps)
openscad -o $@ -D 'camera="picamera_2"' $<
$(OUTPUT)/feet_tall.stl: $(SOURCE)/feet.scad $(all_deps)
openscad -o $@ -D 'foot_height=26' $<
$(OUTPUT)/%.stl: $(SOURCE)/%.scad $(all_deps)
openscad -o $@ $<