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

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

Re: GNU Make: Is it illegal to include within targets?


From: Paul D. Smith
Subject: Re: GNU Make: Is it illegal to include within targets?
Date: 29 Mar 2006 13:04:24 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

%% "nopa" <nopaperfound@yahoo.com> writes:

  n> First I've a command file named "commands.incl", like this

  n> ---cut here---
  n>     cp here there
  n>     cd mydir ; make depend
  n> ---cut here---

  n> (where every line begins by one and just one TAB)
  n> And then I've a Makefile like this:

  n> all:
  n>     make alltools
  n>     make allstuff
  n> include commands.incl
  n>     make therestoftestuff

  n> When trying this with GNU Make it complains "commands commence
  n> before first target. Stop.", and the error is reported at line 1 of
  n> "commands.incl". The docs say that it's because there's a line
  n> beginning with Tab, and outside of a target.

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

Correct.  Rules cannot "contain" include files like this in GNU make.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <psmith@gnu.org>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


reply via email to

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