help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to best tell make where the sources are?


From: Christof Warlich
Subject: Re: how to best tell make where the sources are?
Date: Sun, 03 Jul 2011 11:30:55 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10

> Don't tease! Post it!

Well, here it is, attached, together with some rather nailed-up example source code. It's not the most recent version though, as I currently do not have access to it, but it is good enough to catch the idea, and I will follow-up the current version on
Monday.

A few introducing words for easily getting started:

The core idea that I had in mind when writing EasyMake was to achieve a maximum of simplicity for most projects, while still allowing extensive configuration options to
be able to adapt to a vast variety of specific project needs.

The entire EasyMake code can be found in just _one_ file, called (surprise! ;-)) Makefile. In the most simple case, one just needs to throw that file into a project's root directory and type 'make'. EasyMake will then compile any .c and .cpp files in the current and all subdirectories and finally links the resulting .o files, giving the
linked application the name of the current directory.

Nothing too breathtaking so far, but read on:

- All derived files are put into a separate directory, which is ../derived from the
current directory by default.
- All dependencies due to #include files are handled properly, so that the right
sources are remade whenever a header file changes.
- Any project specific adoptions may be made in separate and _optional_ .mk files
that also need to be put in the project's root directory:
-- The file user.mk may contain all configurations that are common to all platforms
for which one may want to build.
-- Any other .mk files represent a platform for which one may build, with all the derived files having their own directories. For a specific platform .mk file, say
cpu1.mk, you'll need to call 'make PLATFORM=cpu1' to build your project for
cpu1, with all derived files now ending up below ../derived/cpu1 by default.

The provided example has a documented user.mk file and several platform .mk
files included, so please have a look at EasyMake/overall/user.mk for more
information. The example shows a recursive make, with EsayMake/overall being
the top level directory of the build.

To best understand and learn EasyMake's capabilities, I'd recomment to start with commenting out everything in EasyMake/overall/user.mk and then do a default build there. Then you may reenable one option after the other to see their effects.

I'm very interested in your feedback,

Cheers,

Chris

Am 03.07.2011 02:44, schrieb Stephan Beal:
On Fri, Jul 1, 2011 at 6:48 PM, Christof Warlich<address@hidden>wrote:

Based on this and and the auto-dependency-generation technique also being
described there, I wrote a rather generic and highly configurable Makefile
that may well be applied to almost anything that needs to be built. I'd be
happy to share if anyone might be interested.

Don't tease! Post it!

:)


Attachment: EasyMake.tgz
Description: application/compressed-tar


reply via email to

[Prev in Thread] Current Thread [Next in Thread]