-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.in
98 lines (76 loc) · 2.89 KB
/
Makefile.in
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
.PHONY: pipe cal env doc userdoc opendoc unit help clean sswdeps
FLAGS=
QUIET=0
PHONE=$(shell cat $(HOME)/.phonenumber 2> /dev/null)
EMAIL=$(USER)@ucar.edu
ifeq ($(QUIET), 1)
ECHO_PREFIX=@
else
ECHO_PREFIX=
endif
unexport IDL_DIR
IDL=@IDL_EXECUTABLE@
SSWDEPS_IDL=@IDL_EXECUTABLE@
OS:=$(shell uname)
ifeq ($(OS), Darwin)
OPEN=open
else
OPEN=firefox
endif
MACHINE=$(shell comp_get_hostname.sh)
CONFIG=config/comp.$(FLAGS).cfg
CONFIG_FILENAME:=$(shell mktemp)
SSW_DIR=$(PWD)/ssw
GEN_DIR=$(PWD)/gen
LIB_DIR=$(PWD)/lib
COMP_SRC_DIR=$(PWD)/src
MGLIB_DIR=+$(HOME)/software/mglib/lib
MGUNIT_DIR=$(HOME)/software/mgunit/lib
IDLDOC_DIR=+$(HOME)/projects/idldoc/src
FULL_SSW_DIR=/hao/contrib/ssw
COMP_PATH=+$(COMP_SRC_DIR):$(SSW_DIR):$(GEN_DIR):+$(LIB_DIR):"<IDL_DEFAULT>"
DOC_PATH=$(MGLIB_DIR):$(IDLDOC_DIR):$(COMP_PATH)
UNIT_PATH=$(PWD)/unit:$(MGUNIT_DIR):$(COMP_PATH)
SSW_DEP_PATH="<IDL_DEFAULT>":$(COMP_PATH):+$(FULL_SSW_DIR)
help:
@echo "Running on $(MACHINE) by $(USER), using $(CONFIG)"
@echo
@echo "Targets:"
@echo " pipe run the CoMP pipeline"
@echo " cal run the example calibration"
@echo " env start IDL with the CoMP pipeline paths"
@echo " doc generate the CoMP pipeline API documentation"
@echo " userdoc generate the user-level CoMP pipeline API documentation"
@echo " opendoc open the CoMP pipeline API docs in a web browser"
@echo " unit run the CoMP pipeline unit tests"
@echo " clean clean API documentation"
@echo " sswdeps find the SSW dependencies not in ssw dir"
pipe:
$(ECHO_PREFIX)cp $(CONFIG) $(CONFIG_FILENAME)
$(ECHO_PREFIX)$(IDL) -IDL_STARTUP "" -IDL_PATH $(COMP_PATH) -e "comp_run_pipeline, config_filename='$(CONFIG)'"
# @if [ "$(PHONE)" ]; then \
# echo "Sending message to $(PHONE)..."; \
# $(ECHO_PREFIX)sms -n $(PHONE) -m "Done processing pipeline with $(shell basename $(CONFIG))"; \
# else \
# echo "Put phone number in $(HOME)/.phonenumber to be notified when done"; \
# fi
$(ECHO_PREFIX)mail_results.sh $(CONFIG) $(CONFIG_FILENAME) $(EMAIL)
$(ECHO_PREFIX)rm $(CONFIG_FILENAME)
@echo "Finished at $(shell date)"
cal:
$(ECHO_PREFIX)$(IDL) -IDL_STARTUP "" -IDL_PATH calibration:$(COMP_PATH):"+$(FULL_SSW_DIR)" -e ".run comp_cal_example_script"
env:
@echo "comp_run_pipeline, config_filename='$(CONFIG)'"
$(ECHO_PREFIX)$(IDL) -IDL_STARTUP "" -IDL_PATH $(COMP_PATH)
doc:
$(ECHO_PREFIX)$(IDL) -IDL_STARTUP "" -IDL_PATH $(DOC_PATH) -e "comp_make_docs"
userdoc:
$(ECHO_PREFIX)$(IDL) -IDL_STARTUP "" -IDL_PATH $(DOC_PATH) -e "comp_make_docs, /user"
opendoc:
$(ECHO_PREFIX)$(OPEN) api-docs/index.html
unit:
$(ECHO_PREFIX)$(IDL) -IDL_STARTUP "" -IDL_PATH $(UNIT_PATH) -e "comp_run_unittests"
clean:
$(ECHO_PREFIX)rm -rf api-docs api-userdocs
sswdeps:
$(ECHO_PREFIX)$(SSWDEPS_IDL) -IDL_STARTUP "" -IDL_PATH $(SSW_DEP_PATH) -e "comp_find_ssw_dependencies, 'src', '$(FULL_SSW_DIR)'"