Conditionally remove libiberty reference from testsuite
[dyninst.git] / testsuite / nmake.module.tmpl
1\r
2 # Common makefile template for dyninst Tests.  This file is not intended to\r
3 # be a useful Makefile in isolation; instead, it should be included\r
4 # from within an architecture-specific Makefile.\r
5 #\r
6 # $Id: nmake.module.tmpl,v 1.5 2008/10/30 19:15:44 legendre Exp $\r
7 #\r
8 \r
9 SUITE_NAME      = Dyninst\r
10 RELEASE_NUM     = 6.0\r
11 \r
12 DEST            = $(TO_CORE)\$(PROGRAM_DEST)\testsuite\r
13 \r
14 CXXFLAGS     = $(CXXFLAGS) -Dos_windows_test -Darch_x86_test -Dcap_relocation_test -Dcap_dynamic_heap_test \\r
15         -Dcap_stripped_binaries_test -Dcap_async_events_test -Dcap_threads_test -Di386_unknown_nt4_0_test \\r
16         -Di386-unknown-nt4.0_test\r
17 CXXFLAGS     = $(CXXFLAGS) -I$(TO_CORE)/dyninstAPI/h -I$(TO_CORE)/external \\r
18         -I$(TO_CORE)/dynutil/h -I$(TO_CORE)/symtabAPI/h -I$(TO_CORE)/testsuite/src \\r
19         -I$(TO_CORE)/instructionAPI/h /D_DEBUG /Zi -Dsnprintf=_snprintf\r
20 CXXFLAGS_NORM = $(CXXFLAGS) -I$(TO_CORE)/testsuite/src \r
21 CFLAGS       = $(CFLAGS) /Zi /D_DEBUG -I$(TO_CORE)/h\r
22 \r
23 LIBS            = $(TO_CORE)\$(LIBRARY_DEST)\libdyninstAPI.lib $(TO_CORE)\$(LIBRARY_DEST)\libcommon.lib $(TO_CORE)\$(LIBRARY_DEST)\libinstructionAPI.lib\r
24 \r
25 SYSLIBS         = \r
26 \r
27 LIBTESTSUITE = libtestSuite.dll\r
28 LIBDYNINSTCOMP = libtestdyninst.dll\r
29 LIBSYMTABCOMP = libtestsymtab.dll\r
30 LIBINSTRUCTIONCOMP = libtestinstruction.dll\r
31 \r
32 MUTATOR_LIBS = libtestdyninst.lib libtestSuite.lib libdyninstAPI.lib libtestsymtab.lib libsymtabAPI.lib libcommon.lib libtestinstruction.lib libinstructionAPI.lib\r
33 \r
34 SRCS_LIBTESTSUITE = ../src/test_lib.C \\r
35                     ../src/test_lib_dllExecution.C \\r
36                     ../src/ParameterDict.C \\r
37                     ../src/TestData.C \\r
38                     ../src/TestMutator.C \\r
39                     ../src/TestOutputDriver.C \\r
40                     ../src/StdOutputDriver.C \\r
41                     ../src/ResumeLog.C \\r
42                     ../src/test_info_new.C\r
43 \r
44 SRCS_DYNINSTCOMP = ../src/dyninst/dyninst_comp.C \\r
45                    ../src/dyninst/test_lib_mutateeStart.C \\r
46                    ../src/dyninst/Callbacks.C \\r
47                    ../src/dyninst/Process_data.C\r
48 SRCS_DYNINSTTESTLIB = ../src/dyninst/libtestA.c \\r
49                       ../src/dyninst/libtestB.c \\r
50                       ../src/dyninst/libInstMe.c \\r
51                       ../src/dyninst/libLoadMe.c\r
52 !ifdef M_ABI\r
53 DYNINST_TESTLIBS = $(SRCS_DYNINSTTESTLIB:.c=.dll)\r
54 DYNINST_TESTLIBS = $(DYNINST_TESTLIBS:../src/dyninst/=)\r
55 # no ABIs on windows yet, this should be $src_$m_abi.dll\r
56 DYNINST_TESTLIBS_ABI =\r
57 !else\r
58 DYNINST_TESTLIBS = $(SRCS_DYNINSTTESTLIB:.c=.dll)\r
59 DYNINST_TESTLIBS = $(DYNINST_TESTLIBS:../src/dyninst/=)\r
60 DYNINST_TESTLIBS_ABI =\r
61 !endif\r
62 \r
63 TESTLIBS = $(DYNINST_TESTLIBS)\r
64 \r
65 DYNINST_TESTLIBS_OBJS = $(SRCS_DYNINSTTESTLIB:.c=.obj)\r
66 DYNINST_TESTLIBS_OBJS = $(DYNINST_TESTLIBS_OBJS:../src/dyninst/=)\r
67 \r
68 SRCS_SYMTABCOMP = ../src/symtab/symtab_comp.C\r
69 \r
70 OBJS_LIBTESTSUITE = $(SRCS_LIBTESTSUITE:.C=.obj)\r
71 OBJS_LIBTESTSUITE = $(OBJS_LIBTESTSUITE:../src/=)\r
72 \r
73 OBJS_DYNINSTCOMP = $(SRCS_DYNINSTCOMP:.C=.obj)\r
74 OBJS_DYNINSTCOMP = $(OBJS_DYNINSTCOMP:../src/dyninst/=)\r
75 \r
76 OBJS_SYMTABCOMP = $(SRCS_SYMTABCOMP:.C=.obj)\r
77 OBJS_SYMTABCOMP = $(OBJS_SYMTABCOMP:../src/symtab/=)\r
78 \r
79 SRCS_TEMPLATES = ../src/test_driver_templates.C\r
80 OBJS_TEMPLATES = $(SRCS_TEMPLATES:.C=.obj)\r
81 OBJS_TEMPLATES = $(OBJS_TEMPLATES:../src/=)\r
82 \r
83 SRCS_INSTRUCTIONCOMP = ../src/instruction/instruction_comp.C\r
84 \r
85 OBJS_INSTRUCTIONCOMP = $(SRCS_INSTRUCTIONCOMP:.C=.obj)\r
86 OBJS_INSTRUCTIONCOMP = $(OBJS_INSTRUCTIONCOMP:../src/instruction/=)\r
87 \r
88 TESTDRIVER_LIBS = libdyninstAPI.lib libtestSuite.lib libtestdyninst.lib libtestsymtab.lib libtestinstruction.lib\r
89 \r
90 all: $(LIBTESTSUITE) $(LIBDYNINSTCOMP) $(LIBSYMTABCOMP) $(LIBINSTRUCTIONCOMP) test_driver.exe runTests.exe mutators mutatees DatabaseOutputDriver.dll libtestA.dll libtestB.dll\r
91 \r
92 \r
93 UNCOMMON_INSTALL=true\r
94 \r
95 install: all\r
96 \r
97 # try not to have clean remove dbghelp.dll\r
98 clean: \r
99         $(RM) *.ilk\r
100         $(RM) *.exp \r
101         $(RM) *.lib \r
102         $(RM) *.obj \r
103         $(RM)   $(TESTDRIVER_LIBS) libtestA.dll libtestB.dll\r
104         $(RM) *.exe \r
105         $(RM) *.pdb\r
106 \r
107 # Old Install commands if we actually want to install\r
108 # -$(MKDIR) $(DEST)\r
109 # for %X IN ( $(LIBTESTSUITE) test_driver.exe runTests.exe $(TEST_LIBS) $(MUTATEES) libtestA.dll libtestB.dll ) DO $(CP) "%X" $(DEST)\r
110 \r
111 LDFLAGS = /debug -LIBPATH:$(TO_CORE)/../$(PLATFORM)/lib \r
112 LIBS    = libdyninstAPI.lib libsymtabAPI.lib libinstructionAPI.lib\r
113 \r
114 $(LIBTESTSUITE): $(OBJS_LIBTESTSUITE) ../src/test_lib.h\r
115         $(LINK) $(LDFLAGS)  -DLL -out:$@ $(OBJS_LIBTESTSUITE)\r
116 \r
117 $(LIBDYNINSTCOMP): $(OBJS_DYNINSTCOMP) ../src/test_lib.h\r
118         $(LINK) $(LDFLAGS)  -DLL -out:$@ $(OBJS_DYNINSTCOMP) $(LIBS) libtestSuite.lib\r
119 \r
120 $(LIBSYMTABCOMP): $(OBJS_SYMTABCOMP) ../src/test_lib.h\r
121         $(LINK) $(LDFLAGS)  -DLL -out:$@ $(OBJS_SYMTABCOMP) $(LIBS) libtestSuite.lib\r
122 \r
123 $(LIBINSTRUCTIONCOMP): $(OBJS_INSTRUCTIONCOMP) ../src/test_lib.h\r
124         $(LINK) $(LDFLAGS)  -DLL -out:$@ $(OBJS_INSTRUCTIONCOMP) $(LIBS) libtestSuite.lib\r
125 \r
126 $(OBJS_LIBTESTSUITE): $(SRCS_LIBTESTSUITE)\r
127         $(CXX) $(CXXFLAGS_NORM) -DTESTLIB_DLL_BUILD -Dnative_cc=VC.exe -Dnative_cxx=_VC++.exe -I../src/ -c $**\r
128 \r
129 $(OBJS_DYNINSTCOMP): $(SRCS_DYNINSTCOMP)\r
130         $(CXX) $(CXXFLAGS_NORM) -DCOMPLIB_DLL_BUILD -DTESTLIB_DLL_BUILD -Dnative_cc=VC.exe -Dnative_cxx=_VC++.exe -I../src/ -c $**\r
131 \r
132 $(OBJS_SYMTABCOMP): $(SRCS_SYMTABCOMP)\r
133         $(CXX) $(CXXFLAGS_NORM) -DCOMPLIB_DLL_BUILD -DTESTLIB_DLL_BUILD -Dnative_cc=VC.exe -Dnative_cxx=_VC++.exe -I../src/ -c $**\r
134 \r
135 $(OBJS_INSTRUCTIONCOMP): $(SRCS_INSTRUCTIONCOMP)\r
136         $(CXX) $(CXXFLAGS_NORM) -DCOMPLIB_DLL_BUILD -DTESTLIB_DLL_BUILD -Dnative_cc=VC.exe -Dnative_cxx=_VC++.exe -I../src/ -c $**\r
137 \r
138 $(DYNINST_TESTLIBS_OBJS) : $(SRCS_DYNINSTTESTLIB)\r
139         $(CC) -c $(CFLAGS) $(CFLAGS_TESTLIBS)$**\r
140 \r
141 $(DYNINST_TESTLIBS): $(DYNINST_TESTLIBS_OBJS)\r
142         $(LINK) $(TESTLIB_FLAGS) $*.obj -out:$@\r
143 \r
144 \r
145 #CXXTFLAGS := $(filter-out -fno-implicit-templates, $(CXXFLAGS))\r
146 \r
147 $(OBJS_TEMPLATES): $(SRCS_TEMPLATES)\r
148         $(CXX) $(CXXFLAGS) -Dnative_cc=VC.exe -Dnative_cxx=_VC++.exe -I../src/ -c $**\r
149 \r
150 test_info_new.gen.obj: test_info_new.gen.C\r
151         $(CXX) $(CXXFLAGS_NORM) -Dnative_cc=VC.exe -Dnative_cxx=_VC++.exe -I../src/ -c $**\r
152 \r
153 test_driver.exe:  test_driver.obj test_lib.obj test_info_new.gen.obj $(LIBTESTSUITE) $(LIBDYNINSTCOMP) $(LIBSYMTABCOMP)\r
154         $(LINK) $(LDFLAGS) test_driver.obj test_info_new.gen.obj $(TESTDRIVER_LIBS)\r
155 \r
156 test_driver.obj: ../src/test_driver.C\r
157         $(CXX) $(CXXFLAGS_NORM) -Dnative_cc=_VC.exe -Dnative_cxx=_VC++.exe -c $**\r
158 \r
159 runTests.exe: runTests.obj runTests-utils-nt.obj $(OBJS_TEMPLATES)\r
160         $(LINK) $(LDFLAGS) runTests.obj runTests-utils-nt.obj $(OBJS_TEMPLATES)\r
161 \r
162 runTests.obj:  ../src/runTests.C\r
163         $(CXX) $(CXXFLAGS_NORM) -c $**\r
164 runTests-utils-nt.obj: ../src/runTests-utils-nt.C\r
165         $(CXX) $(CXXFLAGS_NORM) -c $**\r
166 \r
167 DatabaseOutputDriver.obj: ../src/DatabaseOutputDriver.C\r
168         $(CXX) $(CXXFLAGS_NORM) -c -I../src/ $**\r
169         \r
170 DatabaseOutputDriver.dll: DatabaseOutputDriver.obj\r
171 # Advapi32.lib needed for GetUserName, Ws2_32.lib required for gethostname\r
172         $(LINK) $(LDFLAGS) -DLL -out:$@ $(TESTDRIVER_LIBS) Advapi32.lib Ws2_32.lib $**\r