From fba970162f483afbeb13781701e87d0478c3de72 Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Tue, 12 Jun 2007 05:06:11 +0000 Subject: [PATCH] INTEGRATION: CWS dmake48 (1.6.16); FILE MERGED 2007/03/17 19:00:37 vq 1.6.16.1: #i73499# Add new .WINPATH attribute to generate Windows style paths (with regular slashes) instead of the default cygwin style (POSIX) paths for dmake's dynamic macros. This attribute is specific for cygwin dmake executables and non-cygwin environments ignore this attribute. The windows style paths use regular slashes ('/') instead of the usual windows backslash ('\') as directory separator to avoid quoting problems (It still is a cygwin dmake!) and cygwin as well as native windows programs should have no problems using this (c:/foo/bar) path representation. The affected macros are $@, $*, $>, $?, $<, $&, $^ and $(PWD), $(MAKEDIR) and $(TMD). Examples: Content of $(PWD) without .WINPATH (default): /cygdrive/c/temp Content of $(PWD) with .WINPATH set: c:/temp --- dmake/infer.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dmake/infer.c b/dmake/infer.c index 3fc588807a33..fcb8d1b4e147 100644 --- a/dmake/infer.c +++ b/dmake/infer.c @@ -1,6 +1,6 @@ /* $RCSfile: infer.c,v $ --- $Revision: 1.6 $ --- last change: $Author: ihi $ $Date: 2006-06-29 11:24:00 $ +-- $Revision: 1.7 $ +-- last change: $Author: obo $ $Date: 2007-06-12 06:06:11 $ -- -- SYNOPSIS -- Infer how to make a target. @@ -523,18 +523,23 @@ static char * buildname( tg, meta, per )/* ============================ Replace '%' with per in meta. Expand the result and return it. */ -char *tg; +char *tg; /* Current target name. */ char *meta; char *per; { char *name; name = Apply_edit( meta, "%", per, FALSE, FALSE ); + /* Handle infered dynamic prerequisites. */ if( strchr(name, '$') ) { HASHPTR m_at; char *tmp; - m_at = Def_macro( "@", tg, M_MULTI ); + /* Set $@ so that a Expand() can use it and remove it afterwards. */ + /* Is $@ already expanded? FIXME: Remove this check later. */ + if( *DmStrPbrk( tg, "${}" ) != '\0' ) + Fatal("$@ [%s] not fully expanded!", tg); + m_at = Def_macro( "@", DO_WINPATH(tg), M_MULTI|M_EXPANDED ); tmp = Expand( name ); if( m_at->ht_value != NIL(char) ) { @@ -542,6 +547,7 @@ char *per; m_at->ht_value = NIL(char); } + /* Free name if Apply_edit() did something. */ if( name != meta ) FREE( name ); name = tmp; }