2 # TopLevel Makefile for the Paradyn (and DyninstAPI) system.
4 # $Id: Makefile,v 1.95 2008/10/03 21:12:39 legendre Exp $
8 # Include additional local definitions (if available)
9 -include ./make.config.local
10 # Include the make configuration specification (site configuration options)
13 BUILD_ID = "$(SUITE_NAME) v$(RELEASE_NUM)$(BUILD_MARK)$(BUILD_NUM)"
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 ProcControlAPI = ready common proccontrol
20 DepGraphAPI = depGraphAPI
21 ValueAdded = valueAdded/sharedMem
25 testsuites = dyninstAPI/tests
26 allSubdirs_noinstall =
28 ifndef DONT_BUILD_DYNINST
29 fullSystem += $(DyninstAPI)
30 Build_list += DyninstAPI
33 ifndef DONT_BUILD_PROCCONTROL
34 fullSystem += proccontrol
35 Build_list += proccontrol
38 ifndef DONT_BUILD_NEWTESTSUITE
39 testsuites += testsuite parseThat
40 allSubdirs_noinstall += testsuite
41 fullSystem += testsuite parseThat
42 Build_list += testsuite parseThat
45 allCoreSubdirs = dyninstAPI_RT common dyninstAPI symtabAPI dynutil instructionAPI
46 allSubdirs = $(allCoreSubdirs) parseThat testsuites valueAdded/sharedMem depGraphAPI stackwalk symEval proccontrol
48 # We're not building the new test suite on all platforms yet
51 # Note that the first rule listed ("all") is what gets made by default,
52 # i.e., if make is given no arguments. Don't add other targets before all!
56 # This rule makes most of the normal recursive stuff. Just about any
57 # target can be passed down to the lower-level Makefiles by listing it
61 +@for subsystem in $(fullSystem); do \
62 if [ -f $$subsystem/$(PLATFORM)/Makefile ]; then \
63 $(MAKE) -C $$subsystem/$(PLATFORM) $@; \
70 +@for subsystem in $(allSubdirs); do \
71 if [ -f $$subsystem/$(PLATFORM)/Makefile ]; then \
72 $(MAKE) -C $$subsystem/$(PLATFORM) $@; \
79 +@for subsystem in $(fullSystem); do \
80 if [ -f $$subsystem/$(PLATFORM)/Makefile ]; then \
81 $(MAKE) -C $$subsystem/$(PLATFORM) install; \
82 elif [ -f $$subsytem/Makefile ]; then \
83 $(MAKE) -C $$subsystem install; \
89 # Check that the main installation directories, etc., are ready for a build,
90 # creating them if they don't already exist! Also touch make.config.local
94 +@for installdir in $(LIBRARY_DEST) $(PROGRAM_DEST) $(INCLUDE_DEST); do \
95 if [ -d $$installdir ]; then \
96 echo "Installation directory $$installdir exists..."; \
99 echo "Creating installation directory $$installdir ...";\
100 mkdir -p $$installdir; \
104 +@if [ ! -f make.config.local ]; then \
105 touch make.config.local; \
108 +@echo "Primary compiler for Paradyn build is:"
109 +@if [ `basename $(CXX)` = "xlC" ]; then \
111 elif [ `basename $(CXX)` = "insure" ]; then \
119 # The "make world" target is set up to build things in the "correct"
120 # order for a build from scratch. It builds and installs things in the
121 # "basicComps" list first, then builds and installs the remaining
122 # Paradyn "subSystems" (excluding the currently optional DyninstAPI).
123 # NB: "make world" has also been set up locally to build the DyninstAPI,
124 # however, this is optional and can be removed if desired.
126 # This make target doesn't go first in the Makefile, though, since we
127 # really only want to make "install" when it's specifically requested.
128 # Note that "world" doesn't do a "clean", since it's nice to be able
129 # to restart a compilation that fails without re-doing a lot of
133 @echo "Build of $(BUILD_ID) starting for $(PLATFORM)!"
134 ifdef DONT_BUILD_DYNINST
135 @echo "Build of DyninstAPI components skipped!"
139 $(MAKE) $(fullSystem)
140 @echo "Build of $(BUILD_ID) complete for $(PLATFORM)!"
142 # "make Paradyn" and "make DyninstAPI" are also useful and valid build targets!
144 DyninstAPI SymtabAPI StackwalkerAPI basicComps subSystems testsuites InstructionAPI ValueAdded DepGraphAPI SymEval ProcControlAPI:
146 @echo "Build of $@ complete."
149 # Low-level directory-targets (used in the sets defined above)
150 # Explicit specification of these rules permits better parallelization
151 # than building subsystems using a for loop
153 .PHONY: $(allSubdirs) $(allSubdirs_noinstall)
156 @if [ -f $@/$(PLATFORM)/Makefile ]; then \
157 $(MAKE) -C $@/$(PLATFORM) && \
158 $(MAKE) -C $@/$(PLATFORM) install; \
159 elif [ -f $@/Makefile ]; then \
161 $(MAKE) -C $@ install; \
163 echo $@ has no Makefile; \
167 $(allSubdirs_noinstall):
168 +@if [ -f $@/$(PLATFORM)/Makefile ]; then \
169 $(MAKE) -C $@/$(PLATFORM); \
170 elif [ -f $@/Makefile ]; then \
173 echo $@ has no Makefile; \
177 # Generate targets of the form install_<target> for all directories in
178 # allSubdirs_noinstall
179 allSubdirs_explicitInstall = $(patsubst %,install_%,$(allSubdirs_noinstall))
180 coreSubdirs_explicitInstall = $(patsubst %,install_%,$(allCoreSubdirs))
182 $(allSubdirs_explicitInstall): install_%: %
183 +@if [ -f $(@:install_%=%)/$(PLATFORM)/Makefile ]; then \
184 $(MAKE) -C $(@:install_%=%)/$(PLATFORM) install; \
185 elif [ -f $(@:install_%=%)/Makefile ]; then \
186 $(MAKE) -C $(@:install_%=%) install; \
188 echo $(@:install_%=%) has no Makefile; \
193 $(coreSubdirs_explicitInstall): install_%: %
194 +@if [ -f $(@:install_%=%)/$(PLATFORM)/Makefile ]; then \
195 $(MAKE) -C $(@:install_%=%)/$(PLATFORM) install; \
196 elif [ -f $(@:install_%=%)/Makefile ]; then \
197 $(MAKE) -C $(@:install_%=%) install; \
199 echo $(@:install_%=%) has no Makefiles; \
202 # dependencies -- keep parallel make from building out of order
203 symtabAPI igen: common
204 stackwalk: symtabAPI dynutil
205 dyninstAPI: symtabAPI instructionAPI
206 symtabAPI dyninstAPI: dynutil
207 dyner codeCoverage dyninstAPI/tests testsuite: dyninstAPI
208 testsuite: $(coreSubdirs_explicitInstall)
210 parseThat: $(coreSubdirs_explicitInstall)
211 proccontrol: $(coreSubdir_explicitInstall)
212 #depGraphAPI: instructionAPI $(coreSubdirs_explicitInstall)
213 # depGraphAPI: instructionAPI dyninstAPI
215 # This rule passes down the documentation-related make stuff to
216 # lower-level Makefiles in the individual "docs" directories.
219 +for subsystem in $(fullSystem); do \
220 if [ -f $$subsystem/docs/Makefile ]; then \
221 $(MAKE) -C $$subsystem/docs $@; \
228 # The "make nightly" target is what should get run automatically every
229 # night. It uses "make world" to build things in the right order for
230 # a build from scratch.
232 # Note that "nightly" should only be run on the primary build site,
233 # and does things like building documentation that don't need to be
234 # built for each different architecture. Other "non-primary" build
235 # sites that run each night should just run "make clean world".
239 $(MAKE) DyninstAPI ValueAdded
241 # Used for UW nightly builds
242 nightly: DyninstAPI ValueAdded parseThat
243 $(MAKE) -C testsuite/$(PLATFORM) all
248 ## $(MAKE) DyninstAPI
250 # $(MAKE) install-man
251 # chmod 644 /p/paradyn/man/man?/*