-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
348 lines (295 loc) · 7.4 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
SELF_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
-include $(SELF_DIR)/local/common.mk
-include $(SELF_DIR)/Make/python.mk
#Apps to build for any basic system
apps_basic = \
sshDigger \
xindiserver \
magAOXMaths \
timeSeriesSimulator \
mzmqClient
#Apps commmon to all MagAO-X control machines
apps_common = \
sysMonitor \
mzmqServer \
streamWriter \
dmMode \
shmimIntegrator \
closedLoopIndi \
dbIngest
#Apps common to RTC and ICC on MagAO-X
apps_rtcicc = \
alignLoop \
acronameUsbHub \
baslerCtrl \
bmcCtrl \
flipperCtrl \
hsfwCtrl \
rhusbMon \
cacaoInterface \
modalPSDs \
userGainCtrl \
refRMS \
streamCircBuff \
zaberCtrl \
zaberLowLevel \
picoMotorCtrl \
psfFit
apps_rtc = \
alpaoCtrl \
ocam2KCtrl \
andorCtrl \
siglentSDG \
ttmModulator \
pi335Ctrl \
pupilFit \
t2wOffloader \
dmSpeckle \
w2tcsOffloader \
pwfsSlopeCalc \
kcubeCtrl \
dmPokeXCorr
apps_icc = \
dmPokeCenter \
filterWheelCtrl \
picamCtrl \
pvcamCtrl \
smc100ccCtrl \
usbtempMon \
xt1121Ctrl \
xt1121DCDU \
koolanceCtrl \
corAlign
apps_aoc = \
trippLitePDU \
tcsInterface \
adcTracker \
kTracker \
koolanceCtrl \
observerCtrl \
stateRuleEngine \
audibleAlerts
apps_tic = \
acronameUsbHub \
baslerCtrl \
bmcCtrl \
trippLitePDU
apps_sim = \
cameraSim \
trippLitePDU
libs_to_build = libtelnet
apps_to_build = $(apps_basic)
ifeq ($(MAGAOX_ROLE),AOC)
apps_to_build += $(apps_common)
apps_to_build += $(apps_aoc)
else ifeq ($(MAGAOX_ROLE),ICC)
apps_to_build += $(apps_common)
apps_to_build += $(apps_rtcicc)
apps_to_build += $(apps_icc)
else ifeq ($(MAGAOX_ROLE),RTC)
apps_to_build += $(apps_common)
apps_to_build += $(apps_rtcicc)
apps_to_build += $(apps_rtc)
else ifeq ($(MAGAOX_ROLE),TIC)
apps_to_build += $(apps_common)
apps_to_build += $(apps_tic)
else ifeq ($(MAGAOX_ROLE),SS)
apps_to_build += $(apps_sim)
endif
all_guis = \
dmCtrlGUI \
dmModeGUI \
offloadCtrlGUI \
pupilGuideGUI \
pwr \
coronAlignGUI \
loopCtrlGUI \
roiGUI \
cameraGUI \
stageGUI
ifeq ($(MAGAOX_ROLE),RTC)
guis_to_build =
else ifeq ($(MAGAOX_ROLE),ICC)
guis_to_build =
else ifeq ($(MAGAOX_ROLE),TIC)
guis_to_build =
else ifeq ($(MAGAOX_ROLE),container)
guis_to_build =
else
guis_to_build = $(all_guis)
endif
all_rtimv_plugins = \
cameraStatus \
indiDictionary \
pwfsAlignment \
dmStatus \
warnings \
acquisition
ifeq ($(MAGAOX_ROLE),RTC)
rtimv_plugins_to_build =
else ifeq ($(MAGAOX_ROLE),ICC)
rtimv_plugins_to_build =
else ifeq ($(MAGAOX_ROLE),TIC)
rtimv_plugins_to_build =
else ifeq ($(MAGAOX_ROLE),container)
rtimv_plugins_to_build =
else
rtimv_plugins_to_build = $(all_rtimv_plugins)
endif
utils_to_build = \
logdump \
logsurgeon \
logstream \
cursesINDI \
xrif2shmim \
xrif2fits
scripts_to_install = \
query_seeing \
sync_cacao \
xctrl \
netconsole_logger \
dmdispbridge \
shmimTCPreceive \
shmimTCPtransmit \
obs_to_movie \
instrument_backup_sync \
cacao_startup_if_present \
git_check_all \
collect_camera_configs_for_darks \
shot_in_the_dark \
howfs_apply \
lowfs_switch \
write_magaox_pidfile \
mount_cgroups1_cpuset \
killIndiZombies \
xlog \
hoblockleaks \
inventory_files \
list_xfiles_by_semester
all: indi_all libs_all flatlogs apps_all guis_all utils_all
install: indi_install libs_install flatlogs_all apps_install guis_install utils_install scripts_install rtscripts_install python_install
#We clean just libMagAOX, and the apps, guis, and utils for normal devel work.
clean: lib_clean apps_clean guis_clean utils_clean tests_clean
#Clean everything.
all_clean: indi_clean libs_clean flatlogs_clean lib_clean apps_clean guis_clean utils_clean doc_clean tests_clean
flatlogs_all:
cd flatlogs/src/ && ${MAKE} install
flatlogs_clean:
cd flatlogs/src/ && ${MAKE} clean
rm -rf flatlogs/bin
indi_all:
cd INDI && ${MAKE} all
indi_install:
cd INDI && ${MAKE} install
indi_clean:
cd INDI && ${MAKE} clean
libs_all:
for lib in ${libs_to_build}; do \
(cd libs/$$lib && ${MAKE} )|| exit 1; \
done
libs_install:
for lib in ${libs_to_build}; do \
(cd libs/$$lib && ${MAKE} install) || exit 1; \
done
sudo -H bash -c "echo $(LIB_PATH) > /etc/ld.so.conf.d/magaox.conf"
sudo -H ldconfig
libs_clean:
for lib in ${libs_to_build}; do \
(cd libs/$$lib && ${MAKE} clean) || exit 1; \
done
lib_clean:
cd libMagAOX && ${MAKE} clean
apps_all: libs_install flatlogs_all
for app in ${apps_to_build}; do \
(cd apps/$$app && ${MAKE} )|| exit 1; \
done
apps_install: flatlogs_all
for app in ${apps_to_build}; do \
(cd apps/$$app && ${MAKE} install) || exit 1; \
done
apps_clean:
for app in ${apps_to_build}; do \
(cd apps/$$app && ${MAKE} clean) || exit 1; \
done
guis_all: libs_install rtimv_plugins_all
for gui in ${guis_to_build}; do \
(cd gui/apps/$$gui && ${MAKE} )|| exit 1; \
done
guis_install: rtimv_plugins_install
for gui in ${guis_to_build}; do \
(cd gui/apps/$$gui && ${MAKE} install) || exit 1; \
done
guis_clean: rtimv_plugins_clean
for gui in ${all_guis}; do \
(cd gui/apps/$$gui && ${MAKE} clean) || exit 1; \
done
rtimv_plugins_all: libs_install
for plg in ${rtimv_plugins_to_build}; do \
(cd gui/rtimv/plugins/$$plg && ${MAKE} )|| exit 1; \
done
rtimv_plugins_install:
for plg in ${rtimv_plugins_to_build}; do \
(cd gui/rtimv/plugins/$$plg && ${MAKE} install) || exit 1; \
done
rtimv_plugins_clean:
for plg in ${rtimv_plugins_to_build}; do \
(cd gui/rtimv/plugins/$$plg && ${MAKE} clean) || exit 1; \
done
scripts_install:
for script in ${scripts_to_install}; do \
sudo -H install -d /opt/MagAOX/bin && \
sudo -H install scripts/$$script /opt/MagAOX/bin && \
sudo -H ln -fs /opt/MagAOX/bin/$$script /usr/local/bin/$$script; \
done
rtscripts_install:
for scriptname in make_cpusets move_irqs; do \
sudo -H install -d /opt/MagAOX/bin && \
if [ -e rtSetup/$(MAGAOX_ROLE)/$$scriptname ]; then \
sudo -H install rtSetup/$(MAGAOX_ROLE)/$$scriptname /opt/MagAOX/bin/$$scriptname && \
sudo -H ln -fs /opt/MagAOX/bin/$$scriptname /usr/local/bin/$$scriptname; \
else \
echo "echo 'No $$scriptname for $$MAGAOX_ROLE'\nexit 0" | sudo -H tee /opt/MagAOX/bin/$$scriptname && \
sudo -H chmod +x /opt/MagAOX/bin/$$scriptname && \
sudo -H ln -fs /opt/MagAOX/bin/$$scriptname /usr/local/bin/$$scriptname; \
fi \
; done
utils_all: flatlogs_all indi_all
for app in ${utils_to_build}; do \
(cd utils/$$app && ${MAKE}) || exit 1; \
done
utils_install: flatlogs_all utils_all
for app in ${utils_to_build}; do \
(cd utils/$$app && ${MAKE} install) || exit 1; \
done
utils_clean:
for app in ${utils_to_build}; do \
(cd utils/$$app && ${MAKE} clean) || exit 1; \
done
test: tests_clean
cd tests && ${MAKE} test || exit 1;
tests_clean:
cd tests && ${MAKE} clean || exit 1;
.PHONY: python_install
python_install:
sudo -H $(PYTHON) -m pip install ./python/
.PHONY: doc
doc:
doxygen doc/config/Doxyfile.libMagAOX
# cp doc/config/customtheme/index.html doc/config/customtheme/magao-x-logo-white.svg doc/output/
.PHONY: doc_clean
doc_clean:
rm -rf doc/output
.PHONY: setup
setup:
@for file in ./local/*.example.mk; do \
dest=$$(echo $$file | sed 's/.example//'); \
if [ ! -e $$dest ]; then cp -v $$file $$dest; fi \
done
@echo "*** Build settings available in local/common.mk ***"
@grep "?=" Make/common.mk || true
@echo "*** Build settings available in local/config.mk ***"
@grep "?=" Make/config.mk || true
@echo "***"
.PHONY: print_role
print_role:
@echo "MAGAOX_ROLE=$(MAGAOX_ROLE)"