[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GNU Make: Is it illegal to include within targets?
From: |
Måns Rullgård |
Subject: |
Re: GNU Make: Is it illegal to include within targets? |
Date: |
Wed, 29 Mar 2006 19:37:36 +0100 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.15 (Security Through Obscurity, linux) |
"nopa" <nopaperfound@yahoo.com> writes:
> Hi,
>
> I've a Makefile which I thought to be legal because it always worked
> fine in the past with non-GNU versions of Make.
>
> First I've a command file named "commands.incl", like this (for
> example):
>
> ---cut here---
> cp here there
> cd mydir ; make depend
> ---cut here---
>
> (where every line begins by one and just one TAB)
>
> And then I've a Makefile like this:
>
> all:
> make alltools
> make allstuff
> include commands.incl
> make therestoftestuff
>
> alltools:
> blah blah blah
>
> When trying this with GNU Make it complains "commands commence before
> first target. Stop.", and the error is reported at line 1 of
> "commands.incl". The docs say that it's because there's a line
> beginning with Tab, and outside of a target.
>
> It's true that the line 1 of "commands.incl" begins with a Tab, but
> it's _INSIDE_ of the "all:" target. And, as I said, it works with
> commercial versions of Make.
The include directive is not standardized at all.
--
Måns Rullgård
mru@inprovide.com