[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Creating plain Makefiles with automake
From: |
Gavin Smith |
Subject: |
Re: Creating plain Makefiles with automake |
Date: |
Mon, 29 Apr 2013 18:21:32 +0100 |
On Sun, Apr 28, 2013 at 8:50 PM, Marko Kreen <address@hidden> wrote:
> On Wed, Apr 24, 2013 at 12:10:44AM +0100, Gavin Smith wrote:
>> In the long run I'd like to see creating and running a build system to be
>> as simple as doing something like
>>
>> $ echo >Makefile.am <<END
>> bin_PROGRAMS = hello
>> hello_SOURCES = hello.c beetroot.h rhubarb.h second.c
>> END
>> $ automake
>> $ make
>
> Alternative way of simplification that is working well
> for my own projects is "Makefile.am is Makefile":
>
> $ wget https://raw.github.com/libusual/antimake/master/antimake.mk
> $ cat > Makefile <<EOF
> bin_PROGRAMS = hello
> hello_SOURCES = hello.c
> include antimake.mk
> EOF
> $ echo 'int main() { return 0; }' > hello.c
> $ make
>
> Note - autoconf integration is available, but optional. So above
> sequence is really all that is needed to build.
I like this approach. I actually thought about making a build system
where the equivalent of Makefile.am would be a fragment which would be
included in a larger makefile, until I realised that the syntax I
would use would be similar to that already used in Makefile.am, so I
might as well base my work on automake. The automake syntax is mostly
make syntax which makes what you've done possible. I would definitely
have had a look at antimake had I known about it a couple of months
ago.
antimake and automake-ng (fork of automake targeting GNU make only)
require GNU make. The changes I've made also introduce a few potential
incompatibilities with make's other than GNU make, but I'm hopeful
that these will be minor and we can perhaps even generate Makefiles
for other makes as well. I think the idea of generation of portable
build systems using portable make and portable shell is sound, even
though it does make things more difficult.