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