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