More fixes for testsuite generated files
[dyninst.git] / testsuite / make.module.tmpl
1 #
2 # make.module.tmpl for test suite
3 # Not intended to be a seperate makefile, but to be used in conjunction with
4 # higher level, platform-specific makefiles in the build directories
5
6 RM = rm -f
7 RMDIR ?= rmdir
8 M_GCC ?= purify $(GCC)
9 M_GXX ?= $(GXX)
10 DEPCC ?= $(GCC)
11 DEPENDFLAGS ?= -MM -MT
12 DEPENDDIR = ./depends
13 VPATH   = ../src $(DEPENDDIR) ../src/dyninst
14
15 IFLAGS = -I../../dyninstAPI/h -I../../symtabAPI/h -I../../dynutil/h -I../../instructionAPI/h -I../../proccontrol/h -I../../patchAPI/h -I../../stackwalk/h -I../../dataflowAPI/h -I../../external
16 LFLAGS = -L../../common/$(PLATFORM) -L../../dwarf/$(PLATFORM) -L../../elf/$(PLATFORM) -L../../symlite/$(PLATFORM) -L../../symtabAPI/$(PLATFORM) -L../../instructionAPI/$(PLATFORM) -L../../parseAPI/$(PLATFORM) -L../../proccontrol/$(PLATFORM) -L../../patchAPI/$(PLATFORM) -L../../stackwalk/$(PLATFORM) -L../../dyninstAPI/$(PLATFORM)
17
18 #######################################################################
19 ### We don't want all of the CFLAGS stuff that came from make.config.
20 ### Strip away most of it.
21 #######################################################################
22
23 # Turn off NO_INITIALIZER_LIST_SUPPORT if we compile test suite with C++11
24 CFLAGS = $(UNIFIED_TEST_DEF:%=%_test) $(ARCH_FLAGS) $(AC_DEF) $(FIRST_INCLUDE) $(IFLAGS) -I../src -g $(BOOST_INCDIR) $(CPPFLAGS)
25 CXXFLAGS = $(CFLAGS)
26 CXXFLAGS += $(PLATFORM_CXXFLAGS) $(CXX_REQ_FLAGS)
27
28 CFLAGS_NATIVE = $(CFLAGS)
29 CXXFLAGS_NATIVE = $(CXXFLAGS)
30 MUTATEE_CFLAGS_NATIVE ?= $(CFLAGS)
31 MUTATEE_CXXFLAGS_NATIVE ?= $(CXXFLAGS)
32
33
34 #######################################################################
35 ###  Generate compiler id strings
36 ###
37 ###  COMPILERT_NATIVE_CC, COMPILERT_NATIVE_CXX must be defined prior to
38 ###  inclusion of this file.  gcc/g++ are handled here as platform-indep
39 ###
40 #######################################################################
41
42 EMPTY:=
43 BLANK:=$(EMPTY) $(EMPTY)
44 LPAREN:=(
45 RPAREN:=)
46 COMMA=,
47 RSQBRACK:=[
48 LSQBRACK:=]
49
50 COMPILERT_GCC = $(shell $(M_GCC) -v 2>&1 | grep version | head -1)
51 COMPILER1_GCC = $(subst $(BLANK),_,$(COMPILERT_GCC))
52 COMPILER2_GCC = $(subst $(LPAREN),_,$(COMPILER1_GCC))
53 COMPILER3_GCC = $(subst $(RSQBRACK),_,$(COMPILER2_GCC))
54 COMPILER4_GCC = $(subst $(LSQBRACK),_,$(COMPILER3_GCC))
55 COMPILER_GCC = $(subst $(RPAREN),_,$(COMPILER4_GCC))
56 MUTATEE_CFLAGS_GNU += -DCOMPILER='"$(COMPILER_GCC)"'
57 MUTATEE_LDFLAGS_GNU += $(LDFLAGS) -L.
58
59 COMPILERT_GXX = $(shell $(M_GCC) -v 2>&1 | grep version | head -1)
60 COMPILER1_GXX = $(subst $(BLANK),_,$(COMPILERT_GXX))
61 COMPILER2_GXX = $(subst $(LPAREN),_,$(COMPILER1_GXX))
62 COMPILER3_GXX = $(subst $(RSQBRACK),_,$(COMPILER2_GXX))
63 COMPILER4_GXX = $(subst $(LSQBRACK),_,$(COMPILER3_GXX))
64 COMPILER_GXX = $(subst $(RPAREN),_,$(COMPILER4_GXX))
65 MUTATEE_CXXFLAGS_GNU += -DCOMPILER='"$(COMPILER_GXX)"'
66
67 COMPILER1_NATIVE_CC = $(subst $(BLANK),_,$(COMPILERT_NATIVE_CC))
68 COMPILER2_NATIVE_CC = $(subst $(LPAREN),_,$(COMPILER1_NATIVE_CC))
69 COMPILER_NATIVE_CC = $(subst $(RPAREN),_,$(COMPILER2_NATIVE_CC))
70 MUTATEE_CFLAGS_NATIVE += -DCOMPILER='"$(COMPILER_NATIVE_CC)"'
71 MUTATEE_LDFLAGS_NATIVE += $(LDFLAGS) -L.
72
73 COMPILER1_NATIVE_CXX = $(subst $(BLANK),_,$(COMPILERT_NATIVE_CXX))
74 COMPILER2_NATIVE_CXX = $(subst $(LPAREN),_,$(COMPILER1_NATIVE_CXX))
75 COMPILER_NATIVE_CXX = $(subst $(RPAREN),_,$(COMPILER2_NATIVE_CXX))
76 MUTATEE_CXXFLAGS_NATIVE += -DCOMPILER='"$(COMPILER_NATIVE_CXX)"'
77
78 LIBDIR += $(LFLAGS)
79
80 #######################################################################
81 ###  Basic definitions (filename prefixes)
82 #######################################################################
83
84 FORALL_MUTATORS =  
85
86 FORALL_MUTATEES = mutatee_util
87
88 SRCS_LIBTESTSUITE = test_lib.C \
89                     test_lib_soExecution.C \
90                     TestData.C \
91                     TestMutator.C \
92                     TestOutputDriver.C \
93                     StdOutputDriver.C \
94                                                   remotetest.C \
95                                                   connection.C \
96                                                   module.C
97
98 SRCS_LIBTESTLAUNCH = CmdLine.C \
99                                                         ParameterDict.C \
100                                                         ResumeLog.C \
101                                                         MutateeStart.C \
102                                                         test_info_new.C
103 # test_info_new.gen.C is also part of LIBTESTLAUNCH, but has special build rules
104
105 OBJS_LIBTESTLAUNCH = $(SRCS_LIBTESTLAUNCH:%.C=%.o)
106
107 SRCS_TEMPLATES = test_driver_templates.C 
108
109 OBJS_LIBTESTSUITE = $(SRCS_LIBTESTSUITE:%.C=%.o)
110 OBJS_TEMPLATES = $(SRCS_TEMPLATES:%.C=%.o)
111
112 ifdef USE_LIBTESTSUITE_EXT_A
113 LIBTESTSUITE = libtestSuite.a
114 LIBTESTLAUNCH = libtestlaunch.a
115 else
116 LIBTESTSUITE = libtestSuite.so
117 LIBTESTLAUNCH = libtestlaunch.so
118 endif
119
120 TESTDRIVER_LDFLAGS += $(DEMANGLER_EXEC_LINK)
121
122 ALL_COMP_DIRS = $(TO_CORE)/common/$(PLATFORM)
123 ALL_COMP_DIRS += $(TO_CORE)/dwarf/$(PLATFORM)
124 ALL_COMP_DIRS += $(TO_CORE)/elf/$(PLATFORM)
125 ALL_COMP_DIRS += $(TO_CORE)/symlite/$(PLATFORM)
126 ALL_COMP_DIRS += $(TO_CORE)/testsuite/$(PLATFORM)
127 ALL_COMP_DIRS += $(TO_CORE)/parseAPI/$(PLATFORM)
128 ALL_COMP_DIRS += $(TO_CORE)/stackwalk/$(PLATFORM)
129 ALL_COMP_DIRS += $(TO_CORE)/proccontrol/$(PLATFORM)
130 ALL_COMP_DIRS += $(TO_CORE)/dyninstAPI/$(PLATFORM)
131 ALL_COMP_DIRS += $(TO_CORE)/symtabAPI/$(PLATFORM)
132 ALL_COMP_DIRS += $(TO_CORE)/instructionAPI/$(PLATFORM)
133 ALL_COMP_DIRS += $(TO_CORE)/patchAPI/$(PLATFORM)
134
135
136 #######################################################
137 # Dyninst infrastructure components
138 #######################################################
139 SRCS_DYNINSTCOMP_LIB = dyninst/dyninst_comp.C \
140                        dyninst/test_lib_mutateeStart.C \
141                        dyninst/Callbacks.C \
142                        dyninst/Process_data.C \
143                        dyninst/ParseThat.C \
144                        dyninst/test_lib_test7.C \
145                        dyninst/test_lib_test9.C
146 OBJS_DYNINSTCOMP_LIB = $(notdir $(SRCS_DYNINSTCOMP_LIB:%.C=%.o))
147 SRCS_DYNINSTTESTLIB = libtestA.c \
148                       libtestB.c \
149                       dyninst/libTest12.c
150
151 #                      dyninst/libInstMe.c \
152 #                      dyninst/libLoadMe.c \
153
154 dyninst_MUTATOR_FLAGS = -L. -ltestdyninst
155
156 DYNINST_TESTLIBS = $(notdir $(SRCS_DYNINSTTESTLIB:%.c=%.so))
157 DYNINST_STATIC_TESTLIBS = $(notdir $(SRCS_DYNINSTTESTLIB:%.c=%.a))
158 ifdef M_ABI
159 DYNINST_TESTLIBS_ABI = $(addsuffix _$(M_ABI).so, $(notdir $(SRCS_DYNINSTTESTLIB:%.c=%)))
160 DYNINST_STATIC_TESTLIBS_ABI = $(addsuffix _$(M_ABI).a, $(notdir $(SRCS_DYNINSTTESTLIB:%.c=%)))
161 else
162 DYNINST_TESTLIBS_ABI =
163 DYNINST_STATIC_TESTLIBS_ABI = 
164 endif
165
166 ifdef USE_LIBTESTSUITE_EXT_A
167 LIBDYNINSTCOMP = libtestdyninst.a
168 else
169 LIBDYNINSTCOMP = libtestdyninst.so
170 endif
171
172 dyninst_MUTATOR_LIB = $(LIBDYNINSTCOMP)
173 dyninst_COMPONENT_LIB = $(LIBDYNINSTCOMP)
174
175 #######################################################
176 # Symtab infrastructure components
177 #######################################################
178 SRCS_SYMTABCOMP_LIB = symtab/symtab_comp.C
179 OBJS_SYMTABCOMP_LIB = $(notdir $(SRCS_SYMTABCOMP_LIB:%.C=%.o))
180 symtab_MUTATOR_FLAGS = -L. -ltestsymtab 
181
182 ifdef USE_LIBTESTSUITE_EXT_A
183 LIBSYMTABCOMP = libtestsymtab.a
184 else
185 LIBSYMTABCOMP = libtestsymtab.so
186 endif
187
188 symtab_MUTATOR_LIB = $(LIBSYMTABCOMP)
189 symtab_COMPONENT_LIB = $(LIBSYMTABCOMP)
190
191 #######################################################
192 # Instruction infrastructure components
193 #######################################################
194 SRCS_INSTRUCTIONCOMP_LIB = instruction/instruction_comp.C
195 OBJS_INSTRUCTIONCOMP_LIB = $(notdir $(SRCS_INSTRUCTIONCOMP_LIB:%.C=%.o))
196 instruction_MUTATOR_FLAGS = -L. -ltestinstruction 
197
198 ifdef USE_LIBTESTSUITE_EXT_A
199 LIBINSTRUCTIONCOMP = libtestinstruction.a
200 else
201 LIBINSTRUCTIONCOMP = libtestinstruction.so
202 endif
203
204 instruction_MUTATOR_LIB = $(LIBINSTRUCTIONCOMP)
205 instruction_COMPONENT_LIB = $(LIBINSTRUCTIONCOMP)
206
207 #######################################################
208 # ProcControlAPI infrastructure components
209 #######################################################
210 SRCS_PROCCONTROLCOMP_LIB = proccontrol/proccontrol_comp.C
211 OBJS_PROCCONTROLCOMP_LIB = $(notdir $(SRCS_PROCCONTROLCOMP_LIB:%.C=%.o))
212 proccontrol_MUTATOR_FLAGS += -L. -ltestproccontrol
213
214 ifdef USE_LIBTESTSUITE_EXT_A
215 LIBPROCCONTROLCOMP = libtestproccontrol.a
216 else
217 LIBPROCCONTROLCOMP = libtestproccontrol.so
218 endif
219
220 proccontrol_MUTATOR_LIB = $(LIBPROCCONTROLCOMP)
221 proccontrol_COMPONENT_LIB = $(LIBPROCCONTROLCOMP)
222
223 ######################################################################
224 ### Main target
225 ######################################################################
226
227 SPACE :=
228 SPACE +=
229 #COMPONENT_LDFLAGS += $(subst $(SPACE),,-Wl,--enable-new-dtags$(ALL_COMP_DIRS:%=,-rpath,%))
230 COMPONENT_LDFLAGS += $(subst $(SPACE),,-Wl$(ALL_COMP_DIRS:%=,-rpath,%))
231
232 all: default
233
234 default: testlibs mutators mutatees_minimum drivers output_drivers components
235         @echo "******************************************************************"
236         @echo "* Build complete."
237         @echo "*"
238         @echo "* High optimization mutatees were not built, use 'make test-full'"
239         @echo "* to build them."
240         @echo "******************************************************************"
241
242 test-full: testlibs mutators mutatees drivers output_drivers components
243 full: test-full
244
245 #######################################################################
246 ###  A list of all the targets we're building, for install purposes
247 #######################################################################
248
249 ALL_TARGETS_DEST                = $(addprefix $(TEST_DEST)/,$(ALL_TARGETS))
250 LIBTESTSUITE_DEST               = $(addprefix $(TEST_DEST)/,$(LIBTESTSUITE))
251
252 #######################################################################
253 ###  Some pattern rules
254 #######################################################################
255
256 CXXTFLAGS := $(filter-out -fno-implicit-templates, $(CXXFLAGS))
257
258 #######################################################################
259 ###  High level targets
260 #######################################################################
261
262 MUTATOR_LDFLAGS := $(LDFLAGS) $(LIBDIR) $(MUTATOR_LIBS) $(MUTATOR_LDFLAGS) -lpthread
263 MUTATOR_SO_LDFLAGS = $(filter-out -liberty, $(MUTATOR_LDFLAGS))
264 MUTATEE_NATIVE_FC_LDFLAGS += $(LDFLAGS)
265 MUTATEE_NATIVE_CXX_OMP_LDFLAGS += $(LDFLAGS)
266 TESTDRIVER_LDFLAGS += $(LDFLAGS)
267
268 # all: testlibs mutators mutatees drivers
269 # See also an addition to the 'all' rule at the end of the file
270
271 ### Automatically generated variables; generated by makemake.py
272
273 include make.mutators.gen
274
275 include make.solo_mutatee.gen
276
277 mutatees:
278
279 mutators:
280
281 components:
282
283 testlibs:
284
285 #######################################################################
286 ###  Filter results, if needed
287 #######################################################################
288
289 MINIMUM_BUILD_FILTER = %_max %_high %_low
290 BUILD_FILTER =
291 ifdef SKIP_BUILD_RTLIB_32
292    BUILD_FILTER += %_32_none_max %_32_none_high %_32_none_low %_32_none_none %_32_pic_max %_32_pic_high %_32_pic_low %_32_pic_none
293 endif
294
295 include $(TO_CORE)/make.components
296
297 ifneq ($(wildcard ../src/dyninst), )
298 ifneq ($(findstring dyninstAPI,$(fullSystem)),)
299 mutatees: $(filter-out $(BUILD_FILTER), $(dyninst_SOLO_MUTATEES))
300 mutatees_minimum: $(filter-out $(BUILD_FILTER), $(filter-out $(MINIMUM_BUILD_FILTER), $(dyninst_SOLO_MUTATEES)))
301 mutators: $(dyninst_MUTATORS_SO)
302 components: $(LIBDYNINSTCOMP)
303 testlibs: $(DYNINST_TESTLIBS) $(DYNINST_STATIC_TESTLIBS)
304 ifndef SKIP_BUILD_RTLIB_32
305 testlibs: $(DYNINST_TESTLIBS_ABI) $(DYNINST_STATIC_TESTLIBS_ABI)
306 dyninst_targs = $(DYNINST_TESTLIBS_ABI) $(DYNINST_STATIC_TESTLIBS_ABI)
307 endif
308 dyninst_targs += $(filter-out $(BUILD_FILTER), $(filter-out $(MINIMUM_BUILD_FILTER), $(dyninst_SOLO_MUTATEES)))
309 dyninst_targs += $(dyninst_MUTATORS_SO) $(LIBDYNINSTCOMP) $(DYNINST_TESTLIBS) $(DYNINST_STATIC_TESTLIBS)
310 endif
311 endif
312
313 ifneq ($(wildcard ../src/symtab), )
314 ifneq ($(findstring symtabAPI,$(fullSystem)),)
315 mutatees: $(filter-out $(BUILD_FILTER), $(symtab_SOLO_MUTATEES))
316 mutatees_minimum: $(filter-out $(BUILD_FILTER), $(filter-out $(MINIMUM_BUILD_FILTER), $(symtab_SOLO_MUTATEES)))
317 mutators: $(symtab_MUTATORS_SO)
318 components: $(LIBSYMTABCOMP)
319 testlibs: $(DYNINST_TESTLIBS) $(DYNINST_STATIC_TESTLIBS)
320 symtab_targs = $(filter-out $(BUILD_FILTER), $(filter-out $(MINIMUM_BUILD_FILTER), $(symtab_SOLO_MUTATEES)))
321 symtab_targs = $(symtab_MUTATORS_SO) $(LIBSYMTABCOMP)
322 endif
323 endif
324
325 ifneq ($(wildcard ../src/instruction), )
326 ifneq ($(findstring instructionAPI,$(fullSystem)),)
327 mutatees: $(filter-out $(BUILD_FILTER), $(instruction_SOLO_MUTATEES))
328 mutatees_minimum: $(filter-out $(BUILD_FILTER), $(filter-out $(MINIMUM_BUILD_FILTER), $(instruction_SOLO_MUTATEES)))
329 mutators: $(instruction_MUTATORS_SO)
330 ifneq ($(instruction_MUTATORS_SO), )
331 components: $(LIBINSTRUCTIONCOMP)
332 testlibs:
333 instruction_targs = $(LIBINSTRUCTIONCOMP)
334 endif
335 instruction_targs += $(filter-out $(BUILD_FILTER), $(filter-out $(MINIMUM_BUILD_FILTER), $(instruction_SOLO_MUTATEES)))
336 instruction_targs += $(instruction_MUTATORS_SO) $(LIBINSTRUCTIONCOMP)
337 endif
338 endif
339
340 ifneq ($(wildcard ../src/proccontrol), )
341 ifneq ($(findstring proccontrol,$(fullSystem)),)
342 mutatees: $(filter-out $(BUILD_FILTER), $(proccontrol_SOLO_MUTATEES)) 
343 mutatees_minimum: $(filter-out $(BUILD_FILTER), $(filter-out $(MINIMUM_BUILD_FILTER), $(proccontrol_SOLO_MUTATEES)))
344 mutators: $(proccontrol_MUTATORS_SO)
345 ifneq ($(proccontrol_MUTATORS_SO), )
346 components: $(LIBPROCCONTROLCOMP)
347 testlibs: $(PROCCONTROL_TESTLIBS) $(PROCCONTROL_TESTLIBS_ABI) $(DYNINST_TESTLIBS) $(DYNINST_TESTLIBS_ABI)
348 proccontrol_targs = $(LIBPROCCONTROLCOMP) $(PROCCONTROL_TESTLIBS) $(PROCCONTROL_TESTLIBS_ABI) $(DYNINST_TESTLIBS) $(DYNINST_TESTLIBS_ABI)
349 endif
350 proccontrol_targs += $(filter-out $(BUILD_FILTER), $(filter-out $(MINIMUM_BUILD_FILTER), $(proccontrol_SOLO_MUTATEES)))
351 proccontrol_targs += $(proccontrol_MUTATORS_SO)
352 endif
353 endif
354
355 common_infra: drivers output_drivers
356
357 dyninstAPI: common_infra $(dyninst_targs) $(symtab_targs) $(instruction_targs) $(proccontrol_targs)
358
359 symtabAPI: common_infra $(symtab_targs)
360
361 instructionAPI: common_infra $(instruction_targs)
362
363 proccontrol: common_infra $(proccontrol_targs)
364
365 install: default
366
367 symlink: all
368
369 clean_solo_mutatees: dyninst_clean_solo_mutatees symtab_clean_solo_mutatees instruction_clean_solo_mutatees proccontrol_clean_solo_mutatees
370
371 clean:
372         @echo Cleaning testsuite
373         -$(HIDE_COMP)$(RM) *.da *.bb. *.bbg 
374         -$(HIDE_COMP)$(RM) $(TESTLIBS) $(TESTLIBS_ABI) $(LIBTESTSUITE) test_driver runTests libTest12.so testdriver_wrapper
375         -$(HIDE_COMP)$(RM) $(dyninst_MUTATORS_SO)
376         -$(HIDE_COMP)$(RM) $(dyninst_SOLO_MUTATEES)
377         -$(HIDE_COMP)$(RM) $(symtab_MUTATORS_SO)
378         -$(HIDE_COMP)$(RM) $(symtab_SOLO_MUTATEES)
379         -$(HIDE_COMP)$(RM) $(instruction_MUTATORS_SO)
380         -$(HIDE_COMP)$(RM) $(instruction_SOLO_MUTATEES)
381         -$(HIDE_COMP)$(RM) $(proccontrol_MUTATORS_SO)
382         -$(HIDE_COMP)$(RM) $(proccontrol_SOLO_MUTATEES)
383         -$(HIDE_COMP)$(RM) $(OUTPUT_DRIVERS)
384         -$(HIDE_COMP)$(RM) $(LIBDYNINSTCOMP)
385         -$(HIDE_COMP)$(RM) $(LIBSYMTABCOMP)
386         -$(HIDE_COMP)$(RM) $(LIBINSTRUCTIONCOMP)
387         -$(HIDE_COMP)$(RM) $(LIBPROCCONTROLCOMP)
388         -$(HIDE_COMP)$(RM) $(DYNINST_TESTLIBS) $(DYNINST_STATIC_TESTLIBS) $(DYNINST_TESTLIBS_ABI) $(DYNINST_STATIC_TESTLIBS_ABI) $(LIBTESTLAUNCH)
389         -$(HIDE_COMP)$(RM) *.o
390         -$(HIDE_COMP)$(RM) test11
391         -$(HIDE_COMP)$(RM) imagefile
392         -$(HIDE_COMP)$(RM) core core.* *.core
393         -$(HIDE_COMP)$(RM) -r _dyninstsaved*
394         -$(HIDE_COMP)$(RM) *.ii *.ti
395         -$(HIDE_COMP)$(RM) .__afs*
396         -$(HIDE_COMP)$(RM) -r binaries
397  
398
399 distclean: clean
400         @if [ -d $(DEPENDDIR) ]; then \
401           $(RM) $(DEPENDDIR)/*.dep; \
402           rmdir $(DEPENDDIR); \
403          fi
404
405 specclean:
406         $(RM) *.gen *.pl tuples test_info_new.gen.C
407
408 ifdef M_ABI
409 $(CALL35_1_OBJ_ABI): $(CALL35_1_SRC_ABI)
410         $(M_GCC) $(M_ABI_FLAG) -c $< $(CFLAGS) $(MUTATEE_CFLAGS_GNU) -o $@ 
411 endif
412
413 testlibs: $(LIBTESTSUITE)
414
415 drivers: test_driver runTests testdriver_wrapper
416
417 .PHONY: clean install distclean mutators mutatees testlibs gnu_mutatees native_mutatees echo all
418
419 #######################################################################
420 ###  Build command for test libraries
421 #######################################################################
422
423 $(dyninst_OBJS_ALL_MUTATORS): %.o : dyninst/%.C $(DEPENDDIR)/%.dep
424         @echo Compiling $@
425         $(HIDE_COMP)$(CXX) -c -o $@ -fPIC $(CXXFLAGS) -I../src/ -I../src/dyninst ../src/dyninst/$*.C
426 $(symtab_OBJS_ALL_MUTATORS): %.o : symtab/%.C $(DEPENDDIR)/%.dep
427         @echo Compiling $@
428         $(HIDE_COMP)$(CXX) -c -o $@ -fPIC $(CXXFLAGS) -I../src/ -I../src/symtab ../src/symtab/$*.C
429 $(instruction_OBJS_ALL_MUTATORS): %.o : instruction/%.C $(DEPENDDIR)/%.dep
430         @echo Compiling $@
431         $(HIDE_COMP)$(CXX) -c -o $@ -fPIC $(CXXFLAGS) -I../src/ -I../src/instruction ../src/instruction/$*.C
432 $(proccontrol_OBJS_ALL_MUTATORS): %.o : proccontrol/%.C $(DEPENDDIR)/%.dep
433         @echo Compiling $@
434         $(HIDE_COMP)$(CXX) -c -o $@ -fPIC $(CXXFLAGS) -I../src/ -I../src/proccontrol ../src/proccontrol/$*.C
435
436 TESTLIB_CC ?= $(CC)
437 $(DYNINST_TESTLIBS): %.so : %.c $(DEPENDDIR)/%.dep
438 ifdef MAKE_SHARED_LIB
439         @echo Compiling $@
440         $(HIDE_COMP)$(TESTLIB_CC) $(LDFLAGS) -c $(CFLAGS) $(CFLAGS_TESTLIBS) $(filter %.c, $^) -o $*.o
441         $(HIDE_COMP)$(MAKE_SHARED_LIB) $(TESTLIB_FLAGS) $*.o -o $@
442 else
443         @echo Compiling $@
444         $(HIDE_COMP)$(TESTLIB_CC) $(LDFLAGS) $(TESTLIB_FLAGS) -I../src/ $(filter %.c,$^) -o $@
445 endif
446
447 $(DYNINST_STATIC_TESTLIBS): %.a : %.c $(DEPENDDIR)/%.dep
448         @echo Compiling $@
449         $(HIDE_COMP)$(TESTLIB_CC) $(LDFLAGS) -c $(CFLAGS) $(CFLAGS_TESTLIBS) $(filter %.c, $^) -o $*.o
450         $(HIDE_COMP)$(AR) rcs $@ $*.o
451
452 ifdef M_ABI
453 $(DYNINST_TESTLIBS_ABI): %_$(M_ABI).so : %.c $(DEPENDDIR)/%.dep
454 ifdef MAKE_SHARED_LIB
455         @echo Compiling $@
456         $(HIDE_COMP)$(TESTLIB_CC) $(LDFLAGS) -c $(CFLAGS) $(CFLAGS_TESTLIBS) $(filter %.c, $^) -o $*.o
457         $(HIDE_COMP)$(MAKE_SHARED_LIB) $(LDFLAGS) $(TESTLIB_FLAGS) $*.o -o $@
458 else
459         @echo Compiling $@
460         $(HIDE_COMP)$(TESTLIB_CC) $(M_ABI_FLAG) $(LDFLAGS) $(TESTLIB_FLAGS) -I../src/ $(filter %.c,$^) -o $@
461 endif
462
463 ifdef cap_instruction_api
464     INSNAPI_LINK = -linstructionAPI
465 endif
466
467 $(DYNINST_STATIC_TESTLIBS_ABI): %_$(M_ABI).a : %.c $(DEPENDDIR)/%.dep
468         @echo Compiling $@
469         $(HIDE_COMP)$(TESTLIB_CC) -c $(M_ABI_FLAG) $(CFLAGS) $(LDFLAGS) $(CFLAGS_TESTLIBS) $(filter %.c, $^) -o $*_$(M_ABI).o
470         $(HIDE_COMP)$(AR) rcs $@ $*_$(M_ABI).o
471 endif
472
473 $(OBJS_TEMPLATES): %.o : ../src/%.C
474         @echo Compiling $@
475         $(HIDE_COMP)$(CXX) -c -o $@ $(CXXTFLAGS) -I../src/ ../src/$*.C
476
477 test_lib_templates.o : ../src/test_lib_templates.C
478         @echo Compiling $@
479         $(HIDE_COMP)$(CXX) -c -o $@ -fPIC $(CXXTFLAGS) -I../src/ ../src/$*.C
480
481 $(OBJS_DYNINSTCOMP_LIB): %.o : ../src/dyninst/%.C $(DEPENDDIR)/%.dep
482         @echo Compiling $@
483         $(HIDE_COMP)$(CXX) -c -o $@ -fPIC $(CXXFLAGS) -I../src/ ../src/dyninst/$*.C
484
485 $(OBJS_SYMTABCOMP_LIB): %.o : ../src/symtab/%.C $(DEPENDDIR)/%.dep
486         @echo Compiling $@
487         $(HIDE_COMP)$(CXX) -c -o $@ -fPIC $(CXXFLAGS) -I../src/ ../src/symtab/$*.C
488
489 $(OBJS_INSTRUCTIONCOMP_LIB): %.o : ../src/instruction/%.C $(DEPENDDIR)/%.dep
490         @echo Compiling $@
491         $(HIDE_COMP)$(CXX) -c -o $@ -fPIC $(CXXFLAGS) -I../src/ ../src/instruction/$*.C
492
493 $(OBJS_PROCCONTROLCOMP_LIB): %.o : ../src/proccontrol/%.C $(DEPENDDIR)/%.dep
494         @echo Compiling $@
495         $(HIDE_COMP)$(CXX) -c -o $@ -fPIC $(CXXFLAGS) -I../src/ ../src/proccontrol/$*.C
496
497 $(OBJS_LIBTESTSUITE): %.o : ../src/%.C $(DEPENDDIR)/%.dep
498         @echo Compiling $@
499         $(HIDE_COMP)$(CXX) -c -o $@ -fPIC $(CXXFLAGS) -I../src/ ../src/$*.C
500
501 # test_info_new.gen.o is special-cased because it makes use of the
502 # COMPILER_CONTROL_DEFS to determine which mutatees to enable for compilers
503 # that are not present at all sites.
504 test_info_new.gen.o: test_info_new.gen.C
505         @echo Compiling $@
506         $(HIDE_COMP)$(CXX) -c -fPIC -o $@ $(CXXFLAGS) $(COMPILER_CONTROL_DEFS) -I../src/ test_info_new.gen.C
507
508 $(OBJS_LIBTESTLAUNCH): %.o :  ../src/%.C ../src/%.h $(DEPENDDIR)/%.dep
509         @echo Compiling $@
510         $(HIDE_COMP)$(CXX) -c -fPIC -o $@ $(CXXFLAGS) -I../src/ ../src/$*.C
511
512 $(LIBDYNINSTCOMP) : $(OBJS_DYNINSTCOMP_LIB) $(LIBTESTSUITE)
513         @echo Linking $<
514         $(HIDE_COMP)$(CXX) -shared $(TESTSUITE_FLAGS) $(LIBDIR) $(OBJS_DYNINSTCOMP_LIB) -o $@ -L. -ltestSuite -ldyninstAPI -lpcontrol -lstackwalk  -lpatchAPI -lparseAPI -lsymtabAPI -linstructionAPI -lcommon -ldynDwarf -ldynElf -lsymLite $(COMPONENT_LDFLAGS)
515
516 $(LIBSYMTABCOMP) : $(OBJS_SYMTABCOMP_LIB) $(LIBTESTSUITE)
517         @echo Linking $<
518         $(HIDE_COMP)$(CXX) -shared $(TESTSUITE_FLAGS) $(LIBDIR) $(OBJS_SYMTABCOMP_LIB) -o $@ -L. -ltestSuite -lsymtabAPI -lcommon -ldynDwarf -ldynElf -lsymLite $(COMPONENT_LDFLAGS)
519
520 $(LIBINSTRUCTIONCOMP) : $(OBJS_INSTRUCTIONCOMP_LIB) $(LIBTESTSUITE)
521         @echo Linking $<
522         $(HIDE_COMP)$(CXX) -shared $(TESTSUITE_FLAGS) $(LIBDIR) $(OBJS_INSTRUCTIONCOMP_LIB) -o $@ -L. -ltestSuite -linstructionAPI -lcommon $(COMPONENT_LDFLAGS)
523
524 $(LIBPROCCONTROLCOMP) : $(OBJS_PROCCONTROLCOMP_LIB) $(LIBTESTSUITE)
525         @echo Linking $<
526         $(HIDE_COMP)$(CXX) -shared $(TESTSUITE_FLAGS) $(LIBDIR) $(OBJS_PROCCONTROLCOMP_LIB) -o $@ -L. -ltestSuite -lpcontrol -lcommon -lsymLite $(COMPONENT_LDFLAGS)
527
528 $(LIBTESTSUITE) : $(OBJS_LIBTESTSUITE) test_lib_templates.o test_lib.h
529         @echo Linking $<
530         $(HIDE_COMP)$(CXX) -shared $(TESTSUITE_FLAGS) $(LIBDIR) $(LIBS_LIBTESTSUITE) $(OBJS_LIBTESTSUITE) test_lib_templates.o -o $@ $(COMPONENT_LDFLAGS)
531
532 $(LIBTESTLAUNCH) : $(OBJS_LIBTESTLAUNCH) test_info_new.gen.o
533         @echo Linking $@
534         $(HIDE_COMP)$(CXX) -shared $(TESTSUITE_FLAGS) $(LIBDIR) -o $@ $^
535 #
536 # Native Fortran mutatees
537
538 # There is no real advantage to generality here since there is only one fortran mutatee
539 # (ie for test1), thus all constituent files are built explicitly
540
541 ifdef NATIVE_FC 
542 test1.mutatee_$(NATIVE_FC).o: ../src/test1.mutateeFort.F
543         $(NATIVE_FC)  $(MUTATEE_NATIVE_FFLAGS) -c -o $@ $^ 
544 test1.mutateeFortC_$(NATIVE_FC).o: ../src/test1.mutateeFortC.c
545         $(NATIVE_FORTRAN_CC) $(MUTATEE_NATIVE_FC_CFLAGS) -c $(filter %.c,$^) -o $@
546
547 $(MUTATEES_NATIVE_FC): test%.mutatee_$(NATIVE_FC) : test%.mutatee_$(NATIVE_FC).o test1.mutateeFortC_$(NATIVE_FC).o test1.mutateeCommon_$(NATIVE_FORTRAN_CC).o mutatee_util_$(NATIVE_FORTRAN_CC).o $(DEPENDDIR)/test%.mutatee_$(NATIVE_FC).dep
548         $(NATIVE_FC) -o $@ $(filter %.o,$^) $(MUTATEE_NATIVE_FC_LDFLAGS) $(MUTATEE_LIBS) 
549 endif
550
551 # Native OpenMP mutatees
552 # There is no real advantage to generality here since there is only one OpenMP mutatee
553 # (ie for test16), thus all constituent files are built explicitly
554 ifdef NATIVE_CXX_OMP 
555 test16.mutatee_$(NATIVE_CXX_OMP).o: ../src/test16.mutatee.c
556         $(NATIVE_CXX_OMP)  $(MUTATEE_NATIVE_CXX_CFLAGS) -o $@ $^ 
557
558 $(MUTATEES_NATIVE_CXX_OMP): test%.mutatee_$(NATIVE_CXX_OMP) : test%.mutatee_$(NATIVE_CXX_OMP).o $(DEPENDDIR)/test%.mutatee_$(NATIVE_CXX_OMP).dep
559         $(NATIVE_CXX_OMP) $(MUTATEE_NATIVE_CXX_OMP_LDFLAGS) -o $@ $(filter %.o,$^) $(MUTATEE_LIBS) 
560
561 #$(MUTATEES_NATIVE_CXX_OMP): ../src/test16.mutatee.c
562 #       $(NATIVE_CXX_OMP)  $(MUTATEE_NATIVE_CXX_CFLAGS) -o $@ $^ 
563
564 endif
565
566
567 # Install directory
568 $(TEST_DEST): 
569         mkdir $(TEST_DEST)
570
571 #######################################################################
572 ###  Generic Mutator build rule:
573 ###
574 ###  resorts to pattern matching test% (matches test1, test2, ... etc)
575 ###  to generate correct, minimal set of prerequisites for each test.
576 ###  It would be nicer to just match something simpler that wasn't 
577 ###  name-dependant, but gnu make is not making this easy.
578 ###
579 #######################################################################
580
581 MUTATEE_DEFS := -Dgnu_cc=_gcc -Dgnu_cxx=_g++
582
583 ifdef M_ABI
584 MUTATEE_DEFS += -Dgnu_abi_cc=_gcc_$(M_ABI) -Dgnu_abi_cxx=_g++_$(M_ABI) -Dm_abi
585 endif
586
587 ifdef M_G77
588 MUTATEE_DEFS += -Dgnu_fc=_g77
589 endif
590
591 ifdef NATIVE_CC
592 MUTATEE_DEFS += -Dnative_cc=_$(NATIVE_CC)
593 endif
594
595 ifdef NATIVE_CXX
596 MUTATEE_DEFS += -Dnative_cxx=_$(NATIVE_CXX)
597 endif
598
599 ifdef NATIVE_FC
600 MUTATEE_DEFS += -Dnative_fc=_$(NATIVE_FC)
601 endif
602
603 runTests.o: ../src/runTests.C $(DEPENDDIR)/runTests.dep
604         @echo Compiling $@
605         $(HIDE_COMP)$(CXX) -c -o $@ $(CXXFLAGS) $(MUTATEE_DEFS) ../src/runTests.C
606 runTests_static.o: ../src/runTests.C $(DEPENDDIR)/runTests.dep
607         @echo Compiling $@
608         $(HIDE_COMP)$(CXX) -c -o $@ $(CXXFLAGS) $(MUTATEE_DEFS) -DSTATIC_TEST_DRIVER ../src/runTests.C
609
610 runTests-utils.o: ../src/runTests-utils.C $(DEPENDDIR)/runTests-utils.dep
611         @echo Compiling $@
612         $(HIDE_COMP)$(CXX) -c -o $@ $(CXXFLAGS) $(MUTATEE_DEFS) ../src/runTests-utils.C
613
614 runTests: runTests.o runTests-utils.o test_driver_templates.o  $(LIBTESTLAUNCH)
615         @echo Linking $@
616         $(HIDE_COMP)$(CXX) $(CXXFLAGS) -o $@ runTests.o runTests-utils.o test_driver_templates.o -L.
617 runTests_static: runTests_static.o runTests-utils.o test_driver_templates.o 
618         @echo Linking $@
619         $(HIDE_COMP)$(CXX) $(CXXFLAGS) -o runTests runTests_static.o runTests-utils.o test_driver_templates.o 
620
621 test_driver.o: ../src/test_driver.C $(DEPENDDIR)/test_driver.dep
622         @echo Compiling $@
623         $(HIDE_COMP)$(CXX) -c -o $@ $(CXXFLAGS) $(MUTATEE_DEFS) ../src/test_driver.C
624
625 testdriver_be.o: ../src/testdriver_be.C $(DEPENDDIR)/testdriver_be.dep
626         @echo Compiling $@
627         $(HIDE_COMP)$(CXX) -c -o $@ $(CXXFLAGS) $(MUTATEE_DEFS) $(LAUNCHMON_BE_CFLAGS) ../src/testdriver_be.C
628
629 testdriver_wrapper.o: ../src/testdriver_wrapper.C ../src/remotetest.h
630         @echo Compiling $@
631         $(HIDE_COMP)$(CXX) -g -c -o $@ $(CXXFLAGS) ../src/testdriver_wrapper.C -Wall
632
633 dynlmon.o: ../src/dynlmon.C $(DEPENDDIR)/dynlmon.dep
634         $(HIDE_COMP)$(CXX) -c -o $@ $(CXXFLAGS) $(MUTATEE_DEFS) $(LAUNCHMON_FE_CFLAGS) -I../../ ../src/dynlmon.C
635
636 test_driver_static.o: ../src/test_driver.C $(DEPENDDIR)/test_driver_static.dep
637         @echo Compiling $@
638         $(HIDE_COMP)$(CXX) -c -o $@ -DSTATIC_TEST_DRIVER $(CXXFLAGS) $(MUTATEE_DEFS) ../src/test_driver.C
639
640 # Deal with static DWARF; we need to link libdwarf.a into test_driver so the symbols are available. 
641 ifeq (xtrue,x$(LIBDWARF_STATIC))
642 STATIC_DWARF_HANDLING = -rdynamic -Wl,--whole-archive
643 ifneq (x,x$(strip $(LIBDWARF_LIB)))
644 STATIC_DWARF_HANDLING += -L$(LIBDWARF_LIB)
645 endif
646 STATIC_DWARF_HANDLING += -ldwarf -Wl,--no-whole-archive 
647 ifneq (x,x$(strip $(LIBELF_LIB)))
648 STATIC_DWARF_HANDLING += -L($LIBELF_LIB)
649 endif
650 STATIC_DWARF_HANDLING += -lelf
651 endif
652
653 test_driver: test_driver.o test_driver_templates.o dynlmon.o testdriver_be.o test_info_new.gen.o $(DEPENDDIR)/test_driver.dep $(LIBTESTSUITE) $(LIBTESTLAUNCH)
654         @echo Linking $@ 
655         $(HIDE_COMP)$(CXX) -o $@ test_driver.o test_driver_templates.o test_info_new.gen.o testdriver_be.o dynlmon.o -L. -ltestSuite $(MUTATOR_LDFLAGS) $(LIBS) $(TESTDRIVER_LDFLAGS) -lcommon -ltestlaunch $(LAUNCHMON_LINK) $(COMPONENT_LDFLAGS) $(EXTRA_LIBS) $(STATIC_DWARF_HANDLING) ; $(TESTDRIVER_EXTRA_LINK_STEP)
656
657 testdriver_wrapper: connection.o testdriver_wrapper.o
658         @echo Linking $@
659         $(HIDE_COMP)$(CXX) -o $@ connection.o testdriver_wrapper.o $(TESTSUITE_FLAGS) $(LAUNCHMON_BE_LINK)
660
661 ######################################################################
662 ### Output Drivers
663 ######################################################################
664
665 OUTPUT_DRIVERS = DatabaseOutputDriver.so
666
667 DatabaseOutputDriver.o : ../src/DatabaseOutputDriver.C # $(DEPENDDIR)/DatabaseOutputDriver.dep
668         @echo Compiling $@
669         $(HIDE_COMP)$(CXX) -c -o $@ -fPIC $(CXXFLAGS) -I../src/ ../src/$*.C
670
671 DatabaseOutputDriver.so: DatabaseOutputDriver.o $(LIBTESTSUITE) # $(DEPENDDIR)/DatabaseOutputDriver.dep
672         @echo Linking $@
673         $(HIDE_COMP)$(CXX) -o $@ -shared $(filter %.o,$^) $(MUTATOR_SO_LDFLAGS) $(LIBDIR) $(LIBS) -L. -ltestSuite
674 ifndef NO_OPT_FLAG
675 ifdef STRIP_SO
676         $(STRIP_SO) $@
677 endif
678 endif
679
680 .PHONY: output_drivers
681 output_drivers: $(OUTPUT_DRIVERS)
682
683 #######################################################################
684 ###  Depends
685 #######################################################################
686
687 DEPS_MUTATORS           += $(DEPENDDIR)/test_driver.dep
688 DEPS_MUTATORS           += $(DEPENDDIR)/testdriver_be.dep
689 DEPS_MUTATORS           += $(DEPENDDIR)/dynlmon.dep
690 DEPS_MUTATORS           += $(DEPENDDIR)/runTests.dep $(DEPENDDIR)/runTests-utils.dep
691 DEPS_SYMTAB_MUTATORS    += $(addprefix $(DEPENDDIR)/,$(symtab_OBJS_ALL_MUTATORS:%.o=%.dep))
692 DEPS_DYNINST_MUTATORS    += $(addprefix $(DEPENDDIR)/,$(dyninst_OBJS_ALL_MUTATORS:%.o=%.dep))
693 DEPS_INSTRUCTION_MUTATORS    += $(addprefix $(DEPENDDIR)/,$(instruction_OBJS_ALL_MUTATORS:%.o=%.dep))
694 DEPS_PROCCONTROL_MUTATORS    += $(addprefix $(DEPENDDIR)/,$(proccontrol_OBJS_ALL_MUTATORS:%.o=%.dep))
695
696 DEPS_MUTATEES_GCC       += $(addprefix $(DEPENDDIR)/,$(addsuffix _gcc.dep, $(MUTATEES_C)))
697 DEPS_MUTATEES_GXX       += $(addprefix $(DEPENDDIR)/,$(addsuffix _g++.dep, $(MUTATEES_CXX)))
698 DEPS_MUTATEES_GXX       += $(addprefix $(DEPENDDIR)/,$(addsuffix _g++.dep, $(MUTATEES_CXX_ONLY)))
699 DEPS_DYNINST_TESTLIBS   = $(addprefix $(DEPENDDIR)/,$(DYNINST_TESTLIBS:%.so=%.dep))
700 DEPS_LIBTESTSUITE        = $(addprefix $(DEPENDDIR)/,$(SRCS_LIBTESTSUITE:%.C=%.dep))
701 DEPS_LIBTESTLAUNCH        = $(addprefix $(DEPENDDIR)/,$(SRCS_LIBTESTLAUNCH:%.C=%.dep))
702 DEPS_DYNINSTCOMP       =  $(addprefix $(DEPENDDIR)/,$(notdir $(SRCS_DYNINSTCOMP_LIB:%.C=%.dep)))
703 DEPS_SYMTABCOMP        = $(addprefix $(DEPENDDIR)/,$(notdir $(SRCS_SYMTABCOMP_LIB:%.C=%.dep)))
704 DEPS_INSTRUCTIONCOMP        = $(addprefix $(DEPENDDIR)/,$(notdir $(SRCS_INSTRUCTIONCOMP_LIB:%.C=%.dep)))
705 DEPS_PROCCONTROLCOMP        = $(addprefix $(DEPENDDIR)/,$(notdir $(SRCS_PROCCONTROLCOMP_LIB:%.C=%.dep)))
706
707 ifdef M_G77
708 DEPS_MUTATEES_G77       += $(addprefix $(DEPENDDIR)/,$(addsuffix _g77.dep, $(MUTATEES_FORTRAN)))
709 endif
710
711 ifdef NATIVE_FC
712 DEPS_MUTATEES_NATIVE_FC += $(addprefix $(DEPENDDIR)/,$(addsuffix _$(NATIVE_FC).dep, $(MUTATEES_FORTRAN)))
713 endif
714
715 ifdef NATIVE_CXX_OMP
716 DEPS_MUTATEES_NATIVE_CXX_OMP += $(addprefix $(DEPENDDIR)/,$(addsuffix _$(NATIVE_CXX_OMP).dep, $(MUTATEES_OPENMP)))
717 endif
718
719 ifdef NATIVE_CC
720 DEPS_MUTATEES_NATIVE_CC += $(addprefix $(DEPENDDIR)/,$(addsuffix _$(NATIVE_CC).dep, $(MUTATEES_C)))
721 endif
722
723 ifdef NATIVE_CXX
724 DEPS_MUTATEES_NATIVE_CXX += $(addprefix $(DEPENDDIR)/,$(addsuffix _$(NATIVE_CXX).dep, $(MUTATEES_CXX)))
725 DEPS_MUTATEES_NATIVE_CXX += $(addprefix $(DEPENDDIR)/,$(addsuffix _$(NATIVE_CXX).dep, $(MUTATEES_CXX_ONLY)))
726 endif
727
728 depend: $(DEPS_MUTATORS)
729
730 depend_dir:
731         @echo "mut deps: $(DEPS_MUTATORS)"
732         @if [ -d $(DEPENDDIR) ]; then \
733           echo "Directory \"$(DEPENDDIR)\" already exists..."; \
734          else \
735           mkdir -p $(DEPENDIR); \
736           echo "Made \"$(DEPENDDIR)\" directory..."; \
737          fi
738
739 $(DEPENDDIR)/test_driver_static.dep: test_driver.C
740         @mkdir -p $(DEPENDDIR)
741         $(HIDE_COMP)$(DEPCC) $(CXXFLAGS) $< $(MUTATOR_CXXFLAGS) -DSTATIC_TEST_DRIVER $(DEPENDFLAGS) $*.o > $@
742
743 $(DEPS_MUTATORS): $(DEPENDDIR)/%.dep : %.C
744         @mkdir -p $(DEPENDDIR)
745         $(HIDE_COMP)$(DEPCC) $(CXXFLAGS) $< $(MUTATOR_CXXFLAGS) $(DEPENDFLAGS) $*.o > $@
746
747 $(DEPS_SYMTAB_MUTATORS): $(DEPENDDIR)/%.dep : symtab/%.C
748         @mkdir -p $(DEPENDDIR)
749         $(HIDE_COMP)$(DEPCC) $(CXXFLAGS) $< $(MUTATOR_CXXFLAGS) $(DEPENDFLAGS) $*.o > $@
750
751 $(DEPS_INSTRUCTION_MUTATORS): $(DEPENDDIR)/%.dep : instruction/%.C
752         @mkdir -p $(DEPENDDIR)
753         $(HIDE_COMP)$(DEPCC) $(CXXFLAGS) $< $(MUTATOR_CXXFLAGS) $(DEPENDFLAGS) $*.o > $@
754
755 $(DEPS_PROCCONTROL_MUTATORS): $(DEPENDDIR)/%.dep : proccontrol/%.C
756         @mkdir -p $(DEPENDDIR)
757         $(HIDE_COMP)$(DEPCC) $(CXXFLAGS) $< $(MUTATOR_CXXFLAGS) $(DEPENDFLAGS) $*.o > $@
758
759 $(DEPS_DYNINST_MUTATORS): $(DEPENDDIR)/%.dep : dyninst/%.C
760         @mkdir -p $(DEPENDDIR)
761         $(HIDE_COMP)$(DEPCC) $(CXXFLAGS) $< $(MUTATOR_CXXFLAGS) $(DEPENDFLAGS) $*.o > $@
762
763 $(DEPS_MUTATEES_GCC): $(DEPENDDIR)/test%.mutatee_gcc.dep : test%.mutatee.c $(SRCS_FORALL_MUTATEES)
764         @mkdir -p $(DEPENDDIR)
765         $(M_GCC) $(CFLAGS) $< $(MUTATEE_CFLAGS) $(DEPENDFLAGS) test$*.mutatee_gcc.o > $@
766
767 $(DEPS_MUTATEES_GXX): $(DEPENDDIR)/test%.mutatee_g++.dep : $(wildcard test%.mutatee.*) $(SRCS_FORALL_MUTATEES)
768         @mkdir -p $(DEPENDDIR)
769         $(M_GXX) $(CXXFLAGS) $< $(MUTATEE_CXXFLAGS) $(DEPENDFLAGS) test$*.mutatee_gxx.o > $@
770
771 $(DEPS_MUTATEES_G77): $(DEPENDDIR)/test%.mutatee_g77.dep : test%.mutateeFort.F $(SRCS_FORALL_MUTATEES)
772         @mkdir -p $(DEPENDDIR)
773         $(M_G77) $(CFLAGS) $< $(MUTATEE_CFLAGS) $(DEPENDFLAGS) test$*.mutateeFort_g77.o > $@
774
775
776 # Use gcc to generate deps for native compilers
777
778 ifdef NATIVE_CC
779 $(DEPS_MUTATEES_NATIVE_CC): $(DEPENDDIR)/test%.mutatee_$(NATIVE_CC).dep : test%.mutatee.c $(SRCS_FORALL_MUTATEES)
780         @mkdir -p $(DEPENDDIR)
781         $(M_GCC) $(CFLAGS) $< $(MUTATEE_CFLAGS) $(DEPENDFLAGS) test$*.mutatee_$(NATIVE_CC).o > $@
782 endif
783
784 ifdef NATIVE_CXX
785 $(DEPS_MUTATEES_NATIVE_CXX): $(DEPENDDIR)/test%.mutatee_$(NATIVE_CXX).dep : $(wildcard test%.mutatee.*) $(SRCS_FORALL_MUTATEES)
786         @mkdir -p $(DEPENDDIR)
787         $(M_GXX) $(CXXFLAGS) $< $(MUTATEE_CXXFLAGS) $(DEPENDFLAGS) test$*.mutatee_$(NATIVE_CXX).o > $@
788 endif
789
790 ifdef NATIVE_FC
791 $(DEPS_MUTATEES_NATIVE_FC): $(DEPENDDIR)/test%.mutatee_$(NATIVE_FC).dep : test%.mutateeFort.F $(SRCS_FORALL_MUTATEES)
792         @mkdir -p $(DEPENDDIR)
793         $(M_G77) $(CFLAGS) $< $(MUTATEE_CFLAGS) $(DEPENDFLAGS) test$*.mutateeFort_$(NATIVE_FC).o > $@
794 endif
795
796 ifdef NATIVE_CXX_OMP
797 $(DEPS_MUTATEES_NATIVE_CXX_OMP): $(DEPENDDIR)/test%.mutatee_$(NATIVE_CXX_OMP).dep : test%.mutatee.c $(SRCS_FORALL_MUTATEES)
798         @mkdir -p $(DEPENDDIR)
799         $(M_GXX) $(CFLAGS) $< $(MUTATEE_CFLAGS) $(DEPENDFLAGS) test$*.mutatee_$(NATIVE_CXX_OMP).o > $@
800 endif
801
802
803 $(DEPS_DYNINST_TESTLIBS): $(DEPENDDIR)/lib%.dep : lib%.c 
804         @mkdir -p $(DEPENDDIR)
805         $(HIDE_COMP)$(DEPCC) $(CXXFLAGS) $< $(MUTATOR_CXXFLAGS) $(DEPENDFLAGS) lib$*.so > $@
806
807 $(DEPS_LIBTESTLAUNCH) $(DEPS_LIBTESTSUITE): $(DEPENDDIR)/%.dep : %.C
808         @mkdir -p $(DEPENDDIR)
809         $(HIDE_COMP)$(DEPCC) $(CXXFLAGS) -I../src $< $(MUTATOR_CXXFLAGS) $(DEPENDFLAGS) $*.o > $@
810
811 $(DEPS_DYNINSTCOMP): $(DEPENDDIR)/%.dep : dyninst/%.C
812         @mkdir -p $(DEPENDDIR)
813         $(HIDE_COMP)$(DEPCC) $(CXXFLAGS) -I../src -I../src/dyninst $< $(MUTATOR_CXXFLAGS) $(DEPENDFLAGS) $*.o > $@
814
815 $(DEPS_SYMTABCOMP): $(DEPENDDIR)/%.dep : symtab/%.C
816         @mkdir -p $(DEPENDDIR)
817         $(HIDE_COMP)$(DEPCC) $(CXXFLAGS) -I../src -I../src/symtab $< $(MUTATOR_CXXFLAGS) $(DEPENDFLAGS) $*.o > $@
818
819 $(DEPS_INSTRUCTIONCOMP): $(DEPENDDIR)/%.dep : instruction/%.C
820         @mkdir -p $(DEPENDDIR)
821         $(HIDE_COMP)$(DEPCC) $(CXXFLAGS) -I../src -I../src/instruction $< $(MUTATOR_CXXFLAGS) $(DEPENDFLAGS) $*.o > $@
822
823 $(DEPS_PROCCONTROLCOMP): $(DEPENDDIR)/%.dep : proccontrol/%.C
824         @mkdir -p $(DEPENDDIR)
825         $(HIDE_COMP)$(DEPCC) $(CXXFLAGS) -I../src -I../src/proccontrol $< $(MUTATOR_CXXFLAGS) $(DEPENDFLAGS) $*.o > $@
826
827 # do not include dep files for "clean" targets
828 ifneq ($(MAKECMDGOALS),clean)
829 ifneq ($(MAKECMDGOALS),distclean)
830 ifneq ($(MAKECMDGOALS),echo)
831
832 -include $(DEPS_MUTATORS)
833 # -include $(DEPS_MUTATEES_GCC)
834 # -include $(DEPS_MUTATEES_GXX)
835 # -include $(DEPS_TESTLIBS)
836
837 ifdef M_G77
838 # -include $(DEPS_MUTATEES_G77)
839 endif
840
841 ifdef NATIVE_CC
842 # -include $(DEPS_MUTATEES_NATIVE_CC)
843 endif
844
845 ifdef NATIVE_CXX
846 -include $(DEPS_MUTATEES_NATIVE_CXX)
847 endif
848
849 ifdef NATIVE_FC
850 -include $(DEPS_MUTATEES_NATIVE_FC)
851 endif
852
853 ifdef NATIVE_CXX_OMP
854 -include $(DEPS_MUTATEES_NATIVE_CXX_OMP)
855 endif
856
857 endif
858 endif
859 endif