harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Salikh Zakirov <sal...@gmail.com>
Subject Re: [drlvm][PATCH/RFC] GNU Make-based build system for DRLVM
Date Wed, 01 Aug 2007 12:28:53 GMT
Xiao-Feng Li wrote:
> I highly support to have a Makefile based build system. Thanks for the
> experiments! Only the nice "-j n" can make it a worth try.

Thanks, I will see if I can it make it "more cross-platform", and then
file a JIRA with a patch.

However, I will need to rely on external help in getting the build
configuration right, as the only platform I have build configuration on
is Linux/ia32. With some work, I can get Linux/x86_64, and with lot of
work (read: unlikely to happen soon), Vista/ia32, but  someone else will
need to fix the build up for other platforms.

Integration with existing ant build is an issue I haven't thought
through, and will be glad to hear some suggestions.

> But I don't suggest to use hard-coded flattened source list in the Makefiles.

Currently most of the makefiles use a bunch of per-directory

	$(wildcard dir/*.cpp)

which is the direct translation from .xml build descriptors, but with
proper care it is possible to have something like

	$(shell /usr/bin/find . -name '*.cpp')

using find expressions to exclude platform-specific files, or
alternatively excluding them later with $(filter-out ...).
The makerules.inc is well prepared to get a different set of sources
on a subsequent runs, and it adjusts the rules accordingly
(using generated on-the-fly included makefile fragment), and the
header file dependencies are taken care of automatically.

<rant about platform-specific file naming>

Concerning the organization and naming of platform-specific sources,
I came to conclusion, that the most build-system-friendly source
file organization would to have a single top-level directory 'arch'
which will contain a bunch of directories for specific platform sources.
In this way, any platform configuration can pick-up
- all sources except arch/**
- arch/specific-platform/**
- arch/specific-platform-variation/**
and this way can be used for arbitrary number of platform (os,
processor, etc.) directories.

The way we have in DRLVM now is deficient in that in order to specify
the source file set for a single platform, you need to know specifically
what other platforms exist, and exclude them all, i.e. something like
for linux/ia32:
- include **
- exclude **/ipf/**
- exclude **/em64t/**
- exclude **/win/**
- exclude **_ipf.cpp
- exclude **_em64t.cpp
- exclude **_win.cpp
- etc.

I think you can notice how the number of cases to specify the single
platform source set grows with the number of platforms. And probably
this was the reason that '**/*.cpp' is not used in current build
descriptors, changed into a bunch of single-directory <include> and
<exclude> declarations.

This maybe something to reconsider as porting to other platforms outside
the initial set of Linux / Windows x ia32 / x86_64 / ipf becomes more
and more inevitable :)

</rant>


Mime
View raw message