This commit enables arbitrary instrumentation points at the last instruction
[dyninst.git] / Makefile
1 #
2 # TopLevel Makefile for the Paradyn (and DyninstAPI) system.
3 #
4 # $Id: Makefile,v 1.54 2002/07/31 22:06:32 bernat Exp $
5 #
6
7 # Include the make configuration specification (site configuration options)
8 include ./make.config
9 # Include additional local (re-)definitions (if available)
10 -include ./make.config.local
11
12 BUILD_ID = "$(SUITE_NAME) v$(RELEASE_NUM)$(BUILD_MARK)$(BUILD_NUM)"
13
14 # "basicComps" is the list of components which need to be built first
15 # with "make world", since they are used building the rest of the system.
16 #
17 # "subSystems" is the list of all other pieces which should be built
18 # as part of Paradyn.
19 #
20 # "DyninstAPI" is the list of additional API components (optional).
21
22 basicComps      = pdutil igen
23 ParadynD        = rtinst paradynd dyninstAPI_RT
24 OldParadynFE    = thread paradyn
25 NewParadynFE    = pdthread paradyn
26 ParadynVC       = visi \
27                 visiClients/tclVisi visiClients/barchart \
28                 visiClients/tableVisi visiClients/phaseTable \
29                 visiClients/histVisi visiClients/terrain \
30                 visiClients/termWin
31 subSystems      = $(ParadynD) $(ParadynFE) $(ParadynVC)
32 DyninstAPI      = dyninstAPI_RT dyninstAPI dyner dyninstAPI/tests 
33
34 # threadComps are temporary SPARC/Solaris-only thread-aware components
35 threadComps     = rtinst/multi-thread-aware paradynd/multi-thread-aware
36
37 # "fullSystem" is the list of all Paradyn & DyninstAPI components to build:
38 # set DONT_BUILD_PARADYN or DONT_BUILD_DYNINST in make.config.local if desired
39 ifdef USE_PTHREADS
40 ParadynFE = $(NewParadynFE)
41 else
42 ParadynFE = $(OldParadynFE)
43 endif
44
45 ifndef DONT_BUILD_PARADYN
46 fullSystem      += $(basicComps)
47 Build_list      += basicComps
48 ifndef DONT_BUILD_FE
49 fullSystem      += $(ParadynFE)
50 Build_list      += ParadynFE
51 endif
52 ifndef DONT_BUILD_DAEMON
53 fullSystem      += $(ParadynD)
54 Build_list      += ParadynD
55 endif
56 ifndef DONT_BUILD_VISIS
57 fullSystem      += $(ParadynVC)
58 Build_list      += ParadynVC
59 endif
60 ifndef DONT_BUILD_PD_MT
61 fullSystem      += $(threadComps)
62 Build_list      += threadComps
63 endif
64 endif
65
66 ifndef DONT_BUILD_DYNINST
67 fullSystem      += $(DyninstAPI)
68 Build_list      += DyninstAPI
69 endif
70
71 # Note that the first rule listed ("all") is what gets made by default,
72 # i.e., if make is given no arguments.  Don't add other targets before all!
73
74 all: ready world
75
76 # This rule makes most of the normal recursive stuff.  Just about any
77 # target can be passed down to the lower-level Makefiles by listing it
78 # as a target here:
79
80 clean install depend:
81         +@for subsystem in $(fullSystem); do                    \
82             if [ -f $$subsystem/$(PLATFORM)/Makefile ]; then    \
83                 $(MAKE) -C $$subsystem/$(PLATFORM) $@;          \
84             else                                                \
85                 true;                                           \
86             fi                                                  \
87         done
88
89 # Check that the main installation directories, etc., are ready for a build,
90 # creating them if they don't already exist!
91
92 ready:
93         +@for installdir in $(LIBRARY_DEST) $(PROGRAM_DEST); do \
94             if [ -d $$installdir ]; then                        \
95                 echo "Installation directory $$installdir exists...";   \
96                 true;                                           \
97             else                                                \
98                 echo "Creating installation directory $$installdir ...";\
99                 mkdir -p $$installdir;                          \
100             fi                                                  \
101         done
102         @echo "Primary compiler for Paradyn build is:"
103         @$(CXX) -v
104
105 # The "make world" target is set up to build things in the "correct"
106 # order for a build from scratch.  It builds and installs things in the
107 # "basicComps" list first, then builds and installs the remaining
108 # Paradyn "subSystems" (excluding the currently optional DyninstAPI).
109 # NB: "make world" has also been set up locally to build the DyninstAPI,
110 # however, this is optional and can be removed if desired.
111 #
112 # This make target doesn't go first in the Makefile, though, since we
113 # really only want to make "install" when it's specifically requested.
114 # Note that "world" doesn't do a "clean", since it's nice to be able
115 # to restart a compilation that fails without re-doing a lot of
116 # unnecessary work.
117
118 intro:
119         @echo "Build of $(BUILD_ID) starting for $(PLATFORM)!"
120 ifdef DONT_BUILD_PARADYN
121         @echo "Build of Paradyn components skipped!"
122 endif
123 ifdef DONT_BUILD_FE
124         @echo "Build of Paradyn front-end components skipped!"
125 endif
126 ifdef DONT_BUILD_DAEMON
127         @echo "Build of Paradyn daemon components skipped!"
128 endif
129 ifdef DONT_BUILD_VISIS
130         @echo "Build of Paradyn visi client components skipped!"
131 endif
132 ifdef DONT_BUILD_PD_MT
133         @echo "Build of ParadynMT components skipped!"
134 endif
135 ifdef DONT_BUILD_DYNINST
136         @echo "Build of DyninstAPI components skipped!"
137 endif
138
139 world: intro
140         +for target in $(Build_list); do                                \
141             ( $(MAKE) $$target ) || exit 1;                             \
142         done
143         @echo "Build of $(BUILD_ID) complete for $(PLATFORM)!"
144
145 # "make Paradyn" and "make DyninstAPI" are also useful and valid build targets!
146
147 Paradyn ParadynD ParadynFE ParadynVC DyninstAPI basicComps subSystems threadComps:
148         @echo "Building $@ ..."
149         @date
150         +for subsystem in $($@); do                             \
151             if [ -f $$subsystem/$(PLATFORM)/Makefile ]; then            \
152                 if ( $(MAKE) -C $$subsystem/$(PLATFORM) all ); then     \
153                     $(MAKE) -C $$subsystem/$(PLATFORM) install;         \
154                 else                                                    \
155                     exit 1;                                             \
156                 fi                                                      \
157             else                                                        \
158                 true;                                                   \
159             fi                                                          \
160         done
161         @echo "Build of $@ complete."
162         @date
163
164 # This rule passes down the documentation-related make stuff to
165 # lower-level Makefiles in the individual "docs" directories.
166
167 docs install-man:
168         +for subsystem in $(fullSystem); do                     \
169             if [ -f $$subsystem/docs/Makefile ]; then           \
170                 $(MAKE) -C $$subsystem/docs $@;                 \
171             else                                                \
172                 true;                                           \
173             fi                                                  \
174         done
175
176
177 # The "make nightly" target is what should get run automatically every
178 # night.  It uses "make world" to build things in the right order for
179 # a build from scratch.  
180 #
181 # Note that "nightly" should only be run on the primary build site,
182 # and does things like building documentation that don't need to be
183 # built for each different architecture.  Other "non-primary" build
184 # sites that run each night should just run "make clean world".
185
186 umd-nightly:
187         $(MAKE) clean
188         $(MAKE) DyninstAPI
189
190 nightly:
191         $(MAKE) clean
192         $(MAKE) world
193 #       $(MAKE) DyninstAPI
194         $(MAKE) docs
195         $(MAKE) install-man
196         chmod 644 /p/paradyn/man/man?/*