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