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