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