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