🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3718

GNU Make: Is it illegal to include within targets?

#3718
From: nopa
Date: Wed, 29 Mar 2006 09:52
40 lines
2208 bytes
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
Technical Details
Message-ID: <1143625957.870353.299610@u72g2000cwu.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!u72g2000cwu.googlegroups.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: fc89c,81d76b36bcbdef2a,start
X-Google-Thread: 109f73,81d76b36bcbdef2a,start
X-Google-Attributes: gidfc89c,gid109f73,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!u72g2000cwu.googlegroups.com!not-for-mail
From: "nopa" <nopaperfound@yahoo.com>
Newsgroups: comp.unix.programmer,gnu.utils.help
Subject: GNU Make: Is it illegal to include within targets?
Date: 29 Mar 2006 01:52:37 -0800
Organization: http://groups.google.com
Lines: 41
Message-ID: <1143625957.870353.299610@u72g2000cwu.googlegroups.com>
NNTP-Posting-Host: 158.42.249.44
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1143625962 21193 127.0.0.1 (29 Mar 2006 09:52:42 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 29 Mar 2006 09:52:42 +0000 (UTC)
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98),gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.0 proxy1.upv.es:3128 (squid/2.5.STABLE4)
Complaints-To: groups-abuse@google.com
Injection-Info: u72g2000cwu.googlegroups.com; posting-host=158.42.249.44;
   posting-account=EnkRwA0AAAC5cgEsnjLVnr3FPjzl4TXV