On 2010-11-21 12:22Z, MiltonSv wrote:
>
> ---------8<----------------
> APPL_OBJ := $(DOBJ)\SourceFile.o
>
> SOURCENAMES = $(addsuffix .c,$(notdir $(basename $(APPL_OBJ))))
> ---------8<----------------
>
> This makes $(SOURCENAMES) contain:
> SourceFile.c
>
> All good so far. Now, assume SourceFile.c is located in C:\Source. Is there
> a way to make Gnu Make
> find the path to this file so that I can get a variable containing:
> C:\Source\SourceFile.c ?
I think you want 'vpath'--see example below.
> I am building this on WindowsXP.
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\opt>type Makefile
vpath %.c /Source
# Note that you don't actually need $(realpath) here:
all: SourceFile.c
@echo $(realpath $<)
@echo $<
C:\opt>make
/Source/SourceFile.c
/Source/SourceFile.c
C:\opt>make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i686-pc-mingw32
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make