-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommon.am
151 lines (101 loc) · 3.47 KB
/
Common.am
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
if DEBUG
OPT = -D_DEBUG -g3 -O0
OPT_LD = -no-install
else
OPT = -DNDEBUG -O3
OPT_LD =
endif
if PARAL_MP
OPEN_MP = -fopenmp
else
OPEN_MP =
endif
MDSPLUS_LIBS = -lMdsObjectsCppShr -lMdsShr -lTreeShr -lTdiShr -lMdsIpShr \
-lstdc++ -lpthread -lm
MDSIPTEST_INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src
AM_CFLAGS = $(OPT) $(MDS_CPPFLAGS) $(MDSIPTEST_INCLUDES)
AM_CXXFLAGS = $(OPT) $(MDS_CPPFLAGS) $(MDSIPTEST_INCLUDES)
AM_LDFLAGS = $(OPT_LD) $(MDS_LDFLAGS)
AM_LIBS = $(MDSPLUS_LIBS) -lrt
AM_DEFAULT_SOURCE_EXT = .cpp
LD_LIBRARY_PATH = $(MDS_LIBDIR)
export LD_LIBRARY_PATH
define addfunc_dialog_bar
dialog_bar() {
if [ -n "$${DIALOG_BAR}" -a x"$${DIALOG_BAR}" != x"no" ]; then
(stdbuf -oL awk '/Completed:/ {print "XXX\n"$$2"\n"$$0"\nXXX"}' \
| dialog --title "$$1" --gauge "Please wait" 7 70);
else
cat;
fi
}
endef
# //////////////////////////////////////////////////////////////////////////// #
# //// MDSPLUS //////////////////////////////////////////////////////////// #
# //////////////////////////////////////////////////////////////////////////// #
define mds_envset
export MDS_PATH=$(MDS_SRCDIR)/tdi
export PATH=$(MDS_BINDIR):${PATH}
export CLASSPATH=$(MDS_CLASSPATH)
export LD_LIBRARY_PATH=$(MDS_LIBDIR):${LD_LIBRARY_PATH}
export MDSPLUS_DIR=$(MDSPLUS_DIR)
export PYTHONPATH=${HOME}/lib/python2.7/site-packages:$(abs_top_builddir):${PYTHONPATH}
endef
mdshell:
@ \
${mds_envset}; \
ln -sf $(MDS_SRCDIR)/mdsobjects/python $(top_builddir)/MDSplus; \
echo "Starting $(SHELL) with MDSplus enviroment"; \
PS1="[\u@\h MDS:\W]\$$ " $(SHELL)
# //////////////////////////////////////////////////////////////////////////// #
# //// IMAGES ///////////////////////////////////////////////////////////// #
# //////////////////////////////////////////////////////////////////////////// #
CLEANFILES =
SUFFIXES =
CLEANFILES += *.csv *.dat *.plt
SUFFIXES += .csv .dat .plt .eps .pdf
.PRECIOUS: %.csv %.dat %.plt
#### implicit rules ####
.csv.dat:
@echo $<
.dat.plt:
@echo $<
.plt.eps:
@gnuplot $<
.plt.pdf:
@gnuplot $<
# //////////////////////////////////////////////////////////////////////////// #
# /// TEX REPORTS ////////////////////////////////////////////////////////// #
# //////////////////////////////////////////////////////////////////////////// #
TEXMFHOME = $(abs_top_builddir)/tex/packages/texmf
TEXMFCONFIG = ${TEXMFHOME}
CLEANFILES += *.log *.idx *.out *.toc *.aux
SUFFIXES += .pdf .dvi
.PRECIOUS: %.pdf %.dvi
if HAVE_PDFLATEX
.tex.pdf:
set -e
-$(MAKE) -C $(top_builddir)/tex/packages all
export TEXMFHOME=${TEXMFHOME}
export TEXMFVAR=${TEXMFHOME}
export TEXMFCONFIG=${TEXMFCONFIG}
-$(PDFLATEX) -interaction nonstopmode $<
# -$(PDFLATEX) -interaction nonstopmode $<
# -$(PDFLATEX) -interaction nonstopmode $<
else
.tex.pdf:
@echo "pdflatex not found in path"
endif
# //////////////////////////////////////////////////////////////////////////// #
# /// DOCKER ////////////////////////////////////////////////////////////// #
# //////////////////////////////////////////////////////////////////////////// #
@DK_DOCKER_TARGETS@
.PHONY: reconfigure
reconfigure:
@ \
echo " -- Reconfiguring build with following parameters: -----------"; \
echo $(shell $(abs_top_builddir)/config.status --config); \
echo " -------------------------------------------------------------"; \
echo ; \
cd '$(top_builddir)' && \
$(abs_top_srcdir)/configure $(shell $(abs_top_builddir)/config.status --config);