bugmake - Bugs: bug #27396, add version of include that treats...


bug #27396: add version of include that treats paths as relative to the included file's directory

Submitted by:  None
Submitted on:  Mon 07 Sep 2009 05:47:46 PM UTC  
Severity: 3 - NormalItem Group: Enhancement
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open
Component Version: 3.81Operating System: Any
Fixed Release: NoneTriage Status: None

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Mon 07 Sep 2009 05:47:46 PM UTC, original submission:

Consider the following Makefile:

lib1.a: lib1.a(foo.o) lib1.a(bar.o)

foo.o: lib.h
bar.o: lib.h bar.h

In another directory I'd like to be able to do the following:

all: prog

prog: main.o ../lib/lib1.a

@include ../lib/Makefile

The @include would treat all the relative pathnames in ../lib/Makefile as relative to ../lib, yielding the equivalent of:

../lib/lib1.a: ../lib/lib1.a(../lib/foo.o) ../lib/lib1.a(../lib/bar.o)

../lib/foo.o: ../lib/lib.h
../lib/bar.o: ../lib/lib.h ../lib/bar.h

The syntax of @include could be something else - maybe include @../lib/Makefile, or some other idea. It should work with -include, so @-include or -@include if you want both (or -include @../lib/Makefile for that syntax).

This is intended to make non-recursive build trees easier to create. You'd still need to use target-specific variables and such, but this would make things easier. In particular, you could @include a gcc-generated dependency file and have it do the right thing.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.


Please enter the title of George Orwell's famous dystopian book (it's a date):



No Changes Have Been Made to This Item

Back to the top

Powered by Savane 3.1-cleanup1