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

Submitter:  None
Submitted:  Mon 07 Sep 2009 05:47:46 PM UTC
Severity:  3 - Normal Item Group:  Enhancement
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Component Version:  3.81 Operating System:  Any
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup

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 Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.


No changes have been made to this item

Back to the top

Powered by Savane 3.13-758e.
Corresponding source code