summaryrefslogtreecommitdiff
path: root/dmake/infer.c
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2007-06-12 05:06:11 +0000
committerOliver Bolte <obo@openoffice.org>2007-06-12 05:06:11 +0000
commit9ff33c00a9c11cba81a8235f8235408e0784c05f (patch)
tree25cf8893768d95583c70cd5678b0dcf52420e006 /dmake/infer.c
parentc6fafea19256a7cb8acd25408e478654f5c2585f (diff)
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
Diffstat (limited to 'dmake/infer.c')
-rw-r--r--dmake/infer.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/dmake/infer.c b/dmake/infer.c
index 356ce6292..fe537f56f 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;
}