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?



_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to