URL: <http://savannah.gnu.org/bugs/?27396>
Summary: add version of include that treats paths as relative to the included file's directory Project: make Submitted by: None Submitted on: 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 Discussion Lock: Any Component Version: 3.81 Operating System: Any Fixed Release: None Triage Status: None _______________________________________________________ Details: 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. _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?27396> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Bug-make mailing list Bug-make@gnu.org http://lists.gnu.org/mailman/listinfo/bug-make