help-make
[Top][All Lists]
Advanced

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

Re: help needed on include and -I


From: Greg Chicares
Subject: Re: help needed on include and -I
Date: Fri, 15 Apr 2005 11:57:11 -0400
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113

On 2005-04-15 10:39 AM, Martin Mensch wrote:
I am trying to add a path to be searched by include. It all works fine if I use -I <pathname> in the command line, when calling make. But I want to have this inside the makefile. I read in the make manual and in the arcive of help-make that I can change the options or flags inside make:
from make manual:
You can also set |MAKEFLAGS| in a makefile, to specify additional flags that should also be in effect for that makefile. Now I tried a lot but I just won't work.
Can someone please give me a makefile line that does it.

I've done things like this in the past:

  MAKEFLAGS = \
    --keep-going \
    --no-builtin-variables \
    --no-builtin-rules \
    --include-dir=$(src_dir) \

Now I specify the location of submakefiles--here's my rationale:

  # Included makefiles are cited by absolute pathname, e.g.
  #   include $(src_dir)/included-file
  #   $(src_dir)/included-file:: ;
  # An '--include-dir' option could make an absolute path unnecessary
  # in the 'include' statement itself, but the empty remake command
  # would not respect '--include-dir'.

  include $(src_dir)/configuration.make
  $(src_dir)/configuration.make:: ;

Where do I have to place it? Can it be right befoe the include line?

I haven't experimented with this--I always just put MAKEFLAGS
at the top of the makefile so it's obvious that I'm overriding
normal behavior.

Can I give only the name of a subdirectory like in -I on the command line and without any ./ or / before and after?

What are you trying that doesn't work?





reply via email to

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