help-gnu-utils
[Top][All Lists]
Advanced

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

GNU Make: Is it illegal to include within targets?


From: nopa
Subject: GNU Make: Is it illegal to include within targets?
Date: 29 Mar 2006 01:52:37 -0800
User-agent: G2/0.2

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.

What's happenning? Does GNU Make assume that "include" also means "end
of target"?

Thanks



reply via email to

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