enable a bunch of tests in rewriter mode. add a couple new tests for the rewriter
[dyninst.git] / Makefile
1 #
2 # TopLevel Makefile for the Paradyn (and DyninstAPI) system.
3 #
4 # $Id: Makefile,v 1.95 2008/10/03 21:12:39 legendre Exp $
5 #
6
7 TO_CORE = .
8 # Include additional local definitions (if available)
9 -include ./make.config.local
10 # Include the make configuration specification (site configuration options)
11 include ./make.config
12
13 BUILD_ID = "$(SUITE_NAME) v$(RELEASE_NUM)$(BUILD_MARK)$(BUILD_NUM)"
14
15 SymtabAPI       = ready common symtabAPI dynutil
16 StackwalkerAPI = ready common symtabAPI stackwalk
17 DyninstAPI      = ready common symtabAPI instructionAPI dyninstAPI_RT dyninstAPI dynutil
18 InstructionAPI  = ready common instructionAPI dynutil
19 DepGraphAPI = DyninstAPI depGraphAPI
20 ValueAdded = valueAdded/sharedMem
21
22
23 testsuites = dyninstAPI/tests 
24 allSubdirs_noinstall =
25
26
27 ifndef DONT_BUILD_DYNINST
28 fullSystem      += $(DyninstAPI)
29 Build_list      += DyninstAPI
30 endif
31
32 ifndef DONT_BUILD_OLDTESTSUITE
33 fullSystem      += dyninstAPI/tests
34 endif
35
36 ifndef DONT_BUILD_NEWTESTSUITE
37 testsuites += newtestsuite parseThat
38 allSubdirs_noinstall += newtestsuite parseThat
39 fullSystem += newtestsuite parseThat
40 Build_list += newtestsuite parseThat
41 endif
42
43 allCoreSubdirs  = dyninstAPI_RT common dyninstAPI symtabAPI dynutil instructionAPI depGraphAPI
44 allSubdirs      = $(allCoreSubdirs) testsuites valueAdded/sharedMem
45
46 # We're not building the new test suite on all platforms yet
47
48
49 # Note that the first rule listed ("all") is what gets made by default,
50 # i.e., if make is given no arguments.  Don't add other targets before all!
51
52 all: ready world
53
54 # This rule makes most of the normal recursive stuff.  Just about any
55 # target can be passed down to the lower-level Makefiles by listing it
56 # as a target here:
57
58 depend:
59         +@for subsystem in $(fullSystem); do                    \
60             if [ -f $$subsystem/$(PLATFORM)/Makefile ]; then    \
61                         $(MAKE) -C $$subsystem/$(PLATFORM) $@;          \
62             else                                                \
63                         true;                                           \
64             fi                                                  \
65         done
66
67 clean distclean:
68         +@for subsystem in $(allSubdirs); do                    \
69             if [ -f $$subsystem/$(PLATFORM)/Makefile ]; then    \
70                         $(MAKE) -C $$subsystem/$(PLATFORM) $@;          \
71             else                                                \
72                         true;                                           \
73             fi                                                  \
74         done
75
76 install:        ready world
77         +@for subsystem in $(fullSystem); do                    \
78                 if [ -f $$subsystem/$(PLATFORM)/Makefile ]; then        \
79                         $(MAKE) -C $$subsystem/$(PLATFORM) install;             \
80                 elif [ -f $$subsytem/Makefile ]; then                   \
81                         $(MAKE) -C $$subsystem install; \
82            else \
83                         true;                                           \
84            fi                                                   \
85         done    
86
87 # Check that the main installation directories, etc., are ready for a build,
88 # creating them if they don't already exist!  Also touch make.config.local
89 # if needed.
90
91 ready:
92         +@for installdir in $(LIBRARY_DEST) $(PROGRAM_DEST) $(INCLUDE_DEST); do \
93             if [ -d $$installdir ]; then                        \
94                 echo "Installation directory $$installdir exists...";   \
95                 true;                                           \
96             else                                                \
97                 echo "Creating installation directory $$installdir ...";\
98                 mkdir -p $$installdir;                          \
99             fi                                                  \
100         done
101
102         +@if [ ! -f make.config.local ]; then   \
103             touch make.config.local;            \
104         fi
105
106         +@echo "Primary compiler for Paradyn build is:"
107         +@if [ `basename $(CXX)` = "xlC" ]; then                \
108                echo "xlC"; \
109         elif [ `basename $(CXX)` = "insure" ]; then \
110                 echo "insure"; \
111         else \
112         echo CXX = $(CXX); \
113           $(CXX) -v; \
114      true; \
115         fi
116
117 # The "make world" target is set up to build things in the "correct"
118 # order for a build from scratch.  It builds and installs things in the
119 # "basicComps" list first, then builds and installs the remaining
120 # Paradyn "subSystems" (excluding the currently optional DyninstAPI).
121 # NB: "make world" has also been set up locally to build the DyninstAPI,
122 # however, this is optional and can be removed if desired.
123 #
124 # This make target doesn't go first in the Makefile, though, since we
125 # really only want to make "install" when it's specifically requested.
126 # Note that "world" doesn't do a "clean", since it's nice to be able
127 # to restart a compilation that fails without re-doing a lot of
128 # unnecessary work.
129
130 intro:
131         @echo "Build of $(BUILD_ID) starting for $(PLATFORM)!"
132 ifdef DONT_BUILD_DYNINST
133         @echo "Build of DyninstAPI components skipped!"
134 endif
135
136 world: intro
137         $(MAKE) $(fullSystem)
138         @echo "Build of $(BUILD_ID) complete for $(PLATFORM)!"
139
140 # "make Paradyn" and "make DyninstAPI" are also useful and valid build targets!
141
142 DyninstAPI SymtabAPI StackwalkerAPI basicComps subSystems testsuites InstructionAPI ValueAdded DepGraphAPI: 
143         $(MAKE) $($@)
144         @echo "Build of $@ complete."
145         @date
146
147 # Low-level directory-targets  (used in the sets defined above)
148 # Explicit specification of these rules permits better parallelization
149 # than building subsystems using a for loop
150
151 .PHONY: $(allSubdirs) $(allSubdirs_noinstall)
152
153 $(allSubdirs): 
154         @if [ -f $@/$(PLATFORM)/Makefile ]; then \
155                 $(MAKE) -C $@/$(PLATFORM) && \
156                 $(MAKE) -C $@/$(PLATFORM) install; \
157         elif [ -f $@/Makefile ]; then \
158                 $(MAKE) -C $@ && \
159                 $(MAKE) -C $@ install; \
160         else \
161                 echo $@ has no Makefile; \
162                 true; \
163         fi
164
165 $(allSubdirs_noinstall):
166         echo "***allSubdirs_noinstall***"
167         +@if [ -f $@/$(PLATFORM)/Makefile ]; then \
168                 $(MAKE) -C $@/$(PLATFORM); \
169         elif [ -f $@/Makefile ]; then \
170                 $(MAKE) -C $@; \
171         else \
172                 echo $@ has no Makefile; \
173                 false; \
174         fi
175
176 # Generate targets of the form install_<target> for all directories in
177 # allSubdirs_noinstall
178 allSubdirs_explicitInstall = $(patsubst %,install_%,$(allSubdirs_noinstall))
179 coreSubdirs_explicitInstall = $(patsubst %,install_%,$(allCoreSubdirs))
180
181 $(allSubdirs_explicitInstall): install_%: %
182         +@if [ -f $(@:install_%=%)/$(PLATFORM)/Makefile ]; then \
183                 $(MAKE) -C $(@:install_%=%)/$(PLATFORM) install; \
184         elif [ -f $(@:install_%=%)/Makefile ]; then \
185                 $(MAKE) -C $(@:install_%=%) install; \
186         else \
187                 echo $(@:install_%=%) has no Makefile; \
188                 true; \
189         fi
190
191
192 $(coreSubdirs_explicitInstall): install_%: %
193         +@if [ -f $(@:install_%=%)/$(PLATFORM)/Makefile ]; then \
194                 $(MAKE) -C $(@:install_%=%)/$(PLATFORM) install; \
195         elif [ -f $(@:install_%=%)/Makefile ]; then \
196                 $(MAKE) -C $(@:install_%=%) install; \
197         else \
198                 echo $(@:install_%=%) has no Makefiles; \
199                 true; \
200         fi
201 # dependencies -- keep parallel make from building out of order
202 symtabAPI igen: common
203 stackwalk: symtabAPI dynutil
204 dyninstAPI: symtabAPI instructionAPI
205 symtabAPI dyninstAPI: dynutil
206 dyner codeCoverage dyninstAPI/tests testsuite newtestsuite: dyninstAPI
207 newtestsuite: $(coreSubdirs_explicitInstall)
208 newtestsuite: parseThat
209 parseThat: $(coreSubdirs_explicitInstall)
210 depGraphAPI: instructionAPI $(coreSubdirs_explicitInstall)
211 # depGraphAPI: instructionAPI dyninstAPI
212
213 # This rule passes down the documentation-related make stuff to
214 # lower-level Makefiles in the individual "docs" directories.
215
216 docs install-man:
217         +for subsystem in $(fullSystem); do                     \
218             if [ -f $$subsystem/docs/Makefile ]; then           \
219                 $(MAKE) -C $$subsystem/docs $@;                 \
220             else                                                \
221                 true;                                           \
222             fi                                                  \
223         done
224
225
226 # The "make nightly" target is what should get run automatically every
227 # night.  It uses "make world" to build things in the right order for
228 # a build from scratch.  
229 #
230 # Note that "nightly" should only be run on the primary build site,
231 # and does things like building documentation that don't need to be
232 # built for each different architecture.  Other "non-primary" build
233 # sites that run each night should just run "make clean world".
234
235 umd-nightly:
236         $(MAKE) clean
237         $(MAKE) DyninstAPI ValueAdded
238
239 # Used for nightly builds
240 nightly: DyninstAPI ValueAdded
241         $(MAKE) -C newtestsuite/$(PLATFORM) all
242
243 #nightly:
244 #       $(MAKE) clean
245 #       $(MAKE) world
246 ##      $(MAKE) DyninstAPI
247 #       $(MAKE) docs
248 #       $(MAKE) install-man
249 #       chmod 644 /p/paradyn/man/man?/*