Getting StartedWe used a Sun
Fire V40z Server, configured with 4 single-core 2.4 GHz AMD
Opteron processors, 8 Gb memory, and 200 Gb of local storage, running
Solaris 10. We downloaded the GLib library (glib-2.8.6 from
ftp.gtk.org/pub/gtk/v2.8/),
and extracted the sources using "gtar" from the
After that we were ready to start the build.
./configure
make
make install
Build with GNU make.For the first build we made the symlink "make ->
gmake". Unfortunately the build failed at the step
"configure", because it did not find a "perl5"
binary. To correct the problem we created one more symlink in our
"bin" directory: real 41.6 user 14.6 sys 3.3 Build with Solaris make.For the second build we used the standard Solaris "make" utility. We changed the symlink, extracted sources and started ./configure. Now "configure" created makefiles with Solaris "make" syntax. The build was successful, and it took 44 seconds to compile all files and to create the library: real 44.1 user 14.9 sys 3.7 Build with Sun Studio 11 dmake.For the third build we used the Sun Studio 11 "dmake"
utility in parallel mode. We changed the link ("make ->
dmake"), and set the environment variables: real 18.0 user 15.3 sys 4.9 Room For Improvement.
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
So what is wrong with using "for ... do ... done"
loop in makefiles? It breaks parallelization. There is a standard way to rewrite such loops using the "make"
language. Here is an example to illustrate the idea. $(RECURSIVE_TARGETS):
@set fnord $$MAKEFLAGS; amf=$$2; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done;
$(RECURSIVE_TARGETS):
target=`echo $@ | sed s/-recursive//`; \
$(MAKE) $(AM_MAKEFLAGS) TARGET=$$target;
$(SUBDIRS): FORCE
echo "Making $(TARGET) in $@";
(cd $@ && $(MAKE) $(AM_MAKEFLAGS) $(TARGET) );
FORCE:
See Also:
Nikolay Molchanov is a member of the Sun Studio tools technical staff, and is responsible for Solaris "make" and "sccs" utilities, Sun Studio distributed make and several components of the Sun Studio IDE. | |||||||
Oracle is reviewing the Sun product roadmap and will provide guidance to customers in accordance with Oracle's standard product communication policies. Any resulting features and timing of release of such features as determined by Oracle's review of roadmaps, are at the sole discretion of Oracle. All product roadmap information, whether communicated by Sun Microsystems or by Oracle, does not represent a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. It is intended for information purposes only, and may not be incorporated into any contract.
|
| ||||||||||||