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