File: Makefile.in

package info (click to toggle)
dmtcp 2.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,496 kB
  • sloc: cpp: 33,592; ansic: 28,099; sh: 6,735; makefile: 1,950; perl: 1,690; python: 1,241; asm: 138; java: 13
file content (238 lines) | stat: -rw-r--r-- 6,139 bytes parent folder | download
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
@SET_MAKE@
LN_S=@LN_S@
OPENMP_CFLAGS=@OPENMP_CFLAGS@
OPENMP_CXXFLAGS=@OPENMP_CXXFLAGS@
CC = @CC@
M32=@M32@
# Unfortunately, there is a name clash for 'DEBUG'.
# --enable-debug intends to set 'DEBUG' in src, but sets it everywhere.
# Here in 'test', we use 'DEBUG' for one-off tests.  So, we unset 'DEBUG'.
CFLAGS = @CFLAGS@ -UDEBUG
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXFLAGS = @CXXFLAGS@
HAS_JAVA= @HAS_JAVA@
HAS_JAVAC= @HAS_JAVAC@
HAS_CMA= @HAS_CMA@
LDFLAGS = @LDFLAGS@
MKDIR_P = @MKDIR_P@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
prefix=@prefix@
exec_prefix=@exec_prefix@
datarootdir=@datarootdir@
bindir = @bindir@
docdir = @docdir@
includedir = @includedir@
infodir = @infodir@
libdir = @libdir@
pkglibdir = $(libdir)/@PACKAGE@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
targetdir = $(top_builddir)

ifeq (${shell uname -m},aarch64)
else
ifeq (${shell uname -m},armv7)
else
ifeq (${shell uname -m},armv7l)
else
DO_PTHREAD_ATFORK = yes
endif
endif
endif

DMTCP_INCLUDE=${top_srcdir}/include

CFLAGS += -I${DMTCP_INCLUDE} -DDMTCP -fPIC -g -std=gnu99
CXXFLAGS += -I${DMTCP_INCLUDE} -DDMTCP -fPIC -g


ifeq ($(M32),1)
  targetdir = $(top_builddir)/lib/$(PACKAGE)/32
  CFLAGS += -m32 -Wa,--32
  CXXFLAGS += -m32 -Wa,--32
  LDFLAGS += -m32 -Wl,-m32 -Wl,-melf_i386 -Wa,--32
else
  HAS_READLINE=@HAS_READLINE@
  READLINE_LIBS=-lreadline -lhistory -lcurses
  HAS_MPICH=@HAS_MPICH@
  MPICH_MPICC=@MPICH_MPICC@
  HAS_OPENMPI=@HAS_OPENMPI@
  OPENMPI_MPICC=@OPENMPI_MPICC@
  HAS_CILK=@HAS_CILK@
  CILKC=@CILKC@
endif

PWD=$(shell pwd)

TESTS=${notdir ${basename ${shell ls $(srcdir)/*.c $(srcdir)/*.cpp $(srcdir)/*.cilk | grep -v 'hellompi.c'}}} \
	${addsuffix .class,${notdir ${basename ${shell ls $(srcdir)/java*.java}}}} \
	hellompich openmpi

tests: $(TESTS)
	cd plugin && ${MAKE}
	#${MAKE} -C credentials

tidy:
	rm -f ckpt_*.dmtcp dmtcp_restart_script* \
	  dmtcp-shared-memory.* dmtcp-test-typescript.tmp core*
	rm -rf ckpt_*
	cd plugin && $(MAKE) tidy > /dev/null

clean: tidy
	rm -f $(TESTS) *.pyc *.so
	#${MAKE} -C credentials clean
	cd plugin && $(MAKE) clean

distclean: clean
	cd plugin && $(MAKE) distclean
	#${MAKE} -C credentials distclean
	rm -f Makefile

# plugin-init will call the INIT event in libdmtcp_plugin-init.so
libdmtcp_plugin-init.so: plugin-init.cpp
	${CXX} ${CXXFLAGS} -shared -fPIC -o $@ $<
plugin-init: libdmtcp_plugin-init.so
	# Don't create executable.  Only the library, above, used on test/sleep1

readline: readline.c
ifeq ($(HAS_READLINE),yes)
	$(CC) -o $@ $< $(CFLAGS) $(READLINE_LIBS)
else
	#$@: required libraries missing, skipping test
endif

syscall-tester: syscall-tester.c
	$(CC) -o $@ $< $(CFLAGS) -rdynamic

timer%: timer%.c
	$(CC) -o $@ $< $(CFLAGS) -lrt

clock: clock.c
	$(CC) -o $@ $< $(CFLAGS) -lrt

# Assume OpenMP exists only if OPENMP_CFLAGS is set.
openmp-%: openmp-%.c
ifneq (${OPENMP_CFLAGS},)
	-${CC} ${CFLAGS} ${OPENMP_CFLAGS} -o $@ $<
else
	#$@: This ${CC} does not support OpenMP, skipping test
endif

# Assume OpenMP exists for C++ only if OPENMP_CXXFLAGS is set.
openmp-%: openmp-%.cpp
ifneq (${OPENMP_CXXFLAGS},)
	-${CXX} ${CXXFLAGS} ${OPENMP_CXXFLAGS} -o $@ $<
else
	#$@: This ${CXX} does not support OpenMP, skipping test
endif

hellompich: hellompi.c
ifeq ($(HAS_MPICH),yes)
	- $(MPICH_MPICC) -o $@ $< $(CFLAGS)
else
	#$@: required libraries missing, skipping test
endif

openmpi: hellompi.c
ifeq ($(HAS_OPENMPI),yes)
	- $(OPENMPI_MPICC) -o $@ $< $(CFLAGS)
else
	#$@: required libraries missing, skipping test
endif

DMTCPPLUGIN_HEADER=$(DMTCP_INCLUDE)/dmtcp.h

dmtcp3: dmtcp3.c
	-$(CC) -o $@ $< $(CFLAGS) -lpthread

dmtcp4: dmtcp4.c
	-$(CC) -o $@ $< $(CFLAGS) -lpthread

dmtcp5: dmtcp5.c
	-$(CC) -o $@ $< $(CFLAGS) -lpthread

pthread%: pthread%.c
	-$(CC) -o $@ $< $(CFLAGS) -lpthread

mutex%: mutex%.c
	-$(CC) -o $@ $< $(CFLAGS) -lpthread

# FIXME:  We should create a test in configure.ac to see if this compiles.
ifeq (${DO_PTHREAD_ATFORK},yes)
libpthread_atfork1.so: pthread_atfork1.c
	${CC} ${CFLAGS} -shared -fPIC -DLIB -o $@ $<
pthread_atfork1: pthread_atfork1.c libpthread_atfork1.so
	${CC} ${CFLAGS} -o $@ $< -L${PWD} -lpthread_atfork1 -lpthread

libpthread_atfork2.so: pthread_atfork2.c
	${CC} ${CFLAGS} -shared -fPIC -DLIB -o $@ $<
pthread_atfork2: pthread_atfork2.c libpthread_atfork2.so
	${CC} ${CFLAGS} -o $@ $< -L${PWD} -lpthread_atfork2 -lpthread
else
# FIXME:  On aarch64, gcc-4.9.2, libcg-2.19, pthread_atfork error:
#    /usr/bin/ld: pthread_atfork: hidden symbol `pthread_atfork' in ...
#                                 is referenced by DSO
pthread_atfork1: pthread_atfork1.c
	@ echo "FIXME: pthread_atfork is not being compiled for arm/aarch64"
pthread_atfork2: pthread_atfork2.c
	@ echo "FIXME: pthread_atfork is not being compiled for arm/aarch64"
endif

ifeq (${HAS_CMA},yes)
cma: cma.c
	$(CC) -o $@ $< $(CFLAGS)
else
cma: cma.c
	@ echo "#cma: Skipping test for cma.  CMA requires Linux 3.2 or later."
endif

posix-mq%: posix-mq%.c
	-$(CC) -o $@ $< $(CFLAGS) -lrt

inotify%: inotify%.c
	-$(CC) -o $@ $< $(CFLAGS) -lpthread

# dlopen1 will dlopen/dlclose libdlopen-lib[12].so
libdlopen-lib1.so: dlopen1.c
	${CC} ${CFLAGS} -shared -fPIC  -DLIB1 -o $@ $<
libdlopen-lib2.so: dlopen1.c
	${CC} ${CFLAGS} -shared -fPIC  -DLIB2 -o $@ $<
dlopen1: dlopen1.c libdlopen-lib1.so libdlopen-lib2.so
	${CC} $(CFLAGS) -o $@ $< -ldl

# dlopen2 will dlopen/dlclose libdlopen-lib[34].so
libdlopen-lib3.so: dlopen2.cpp
	${CXX} ${CXXFLAGS} -shared -fPIC -DLIB3 -o $@ $<
libdlopen-lib4.so: dlopen2.cpp
	${CXX} ${CXXFLAGS} -shared -fPIC -DLIB4 -o $@ $<
dlopen2: dlopen2.cpp libdlopen-lib3.so libdlopen-lib4.so
	${CXX} ${CXXFLAGS} -o $@ $< -ldl

%.class: %.java
ifeq ($(HAS_JAVAC),yes)
	javac $< -d .
else
	#$@: required 'javac' missing, skipping test
endif

cilk%: cilk%.cilk
ifeq ($(HAS_CILK),yes)
	${CILKC} -o $@ $<
else
	#$@: required 'cilkc' missing, skipping test
endif

%: %.c
	$(CC) -o $@ $< $(CFLAGS)

%: %.cpp
	$(CXX) -o $@ $< $(CXXFLAGS)