restructured subsystem definitons
[dyninst.git] / Makefile
1 #
2 # TopLevel Makefile for the Paradyn (and DyninstAPI) system.
3 #
4 # $Id: Makefile,v 1.45 2000/12/17 03:42:26 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      = pdutil pdutilOld igen
23 ParadynD        = rtinst paradynd
24 ParadynFE       = thread paradyn
25 ParadynVC       = visi \
26                 visiClients/tclVisi visiClients/barchart \
27                 visiClients/tableVisi visiClients/phaseTable \
28                 visiClients/histVisi visiClients/terrain
29 subSystems      = $(ParadynD) $(ParadynFE) $(ParadynVC)
30 DyninstAPI      = dyninstAPI_RT dyninstAPI dyner dyninstAPI/tests 
31
32 # threadComps are temporary SPARC/Solaris-only thread-aware components
33 threadComps     = rtinst/multi-thread-aware paradynd/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:
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         @echo "Primary compiler for Paradyn build is:"
95         @$(CXX) -v
96
97 # The "make world" target is set up to build things in the "correct"
98 # order for a build from scratch.  It builds and installs things in the
99 # "basicComps" list first, then builds and installs the remaining
100 # Paradyn "subSystems" (excluding the currently optional DyninstAPI).
101 # NB: "make world" has also been set up locally to build the DyninstAPI,
102 # however, this is optional and can be removed if desired.
103 #
104 # This make target doesn't go first in the Makefile, though, since we
105 # really only want to make "install" when it's specifically requested.
106 # Note that "world" doesn't do a "clean", since it's nice to be able
107 # to restart a compilation that fails without re-doing a lot of
108 # unnecessary work.
109
110 intro:
111         @echo "Build of $(BUILD_ID) starting for $(PLATFORM)!"
112 ifdef DONT_BUILD_PARADYN
113         @echo "Build of Paradyn components skipped!"
114 endif
115 ifdef DONT_BUILD_FE
116         @echo "Build of Paradyn front-end components skipped!"
117 endif
118 ifdef DONT_BUILD_DAEMON
119         @echo "Build of Paradyn daemon components skipped!"
120 endif
121 ifdef DONT_BUILD_VISIS
122         @echo "Build of Paradyn visi client components skipped!"
123 endif
124 ifdef DONT_BUILD_PD_MT
125         @echo "Build of ParadynMT components skipped!"
126 endif
127 ifdef DONT_BUILD_DYNINST
128         @echo "Build of DyninstAPI components skipped!"
129 endif
130
131 world: intro
132         +for target in $(Build_list); do                                \
133             ( $(MAKE) $$target ) || exit 1;                             \
134         done
135         @echo "Build of $(BUILD_ID) complete for $(PLATFORM)!"
136
137 # "make Paradyn" and "make DyninstAPI" are also useful and valid build targets!
138
139 Paradyn ParadynD ParadynFE ParadynVC DyninstAPI basicComps subSystems threadComps:
140         @echo "Building $@ ..."
141         @date
142         +for subsystem in $($@); do                             \
143             if [ -f $$subsystem/$(PLATFORM)/Makefile ]; then            \
144                 if ( $(MAKE) -C $$subsystem/$(PLATFORM) all ); then     \
145                     $(MAKE) -C $$subsystem/$(PLATFORM) install;         \
146                 else                                                    \
147                     exit 1;                                             \
148                 fi                                                      \
149             else                                                        \
150                 true;                                                   \
151             fi                                                          \
152         done
153         @echo "Build of $@ complete."
154         @date
155
156 # This rule passes down the documentation-related make stuff to
157 # lower-level Makefiles in the individual "docs" directories.
158
159 docs install-man:
160         +for subsystem in $(fullSystem); do                     \
161             if [ -f $$subsystem/docs/Makefile ]; then           \
162                 $(MAKE) -C $$subsystem/docs $@;                 \
163             else                                                \
164                 true;                                           \
165             fi                                                  \
166         done
167
168
169 # The "make nightly" target is what should get run automatically every
170 # night.  It uses "make world" to build things in the right order for
171 # a build from scratch.  
172 #
173 # Note that "nightly" should only be run on the primary build site,
174 # and does things like building documentation that don't need to be
175 # built for each different architecture.  Other "non-primary" build
176 # sites that run each night should just run "make clean world".
177
178 nightly:
179         $(MAKE) clean
180         $(MAKE) world
181 #       $(MAKE) DyninstAPI
182         $(MAKE) docs
183         $(MAKE) install-man
184         chmod 644 /p/paradyn/man/man?/*