Issue 61170 - dmake macro TMD is not working correctly
Summary: dmake macro TMD is not working correctly
Status: CLOSED FIXED
Alias: None
Product: Build Tools
Classification: Code
Component: dmake (show other issues)
Version: current
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: hjs
QA Contact: issues@tools
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-26 02:27 UTC by quetschke
Modified: 2013-08-07 15:34 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Patch for dmake/ (3.94 KB, patch)
2006-01-26 02:43 UTC, quetschke
no flags Details | Diff
Patch for dmake/ (3.50 KB, patch)
2006-02-03 19:46 UTC, quetschke
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description quetschke 2006-01-26 02:27:22 UTC
I accidentally found that the TMD macro is not set correctly if the current
dir is changed to a full part or a path that contains spaces. E.g.:
- - - snip - - -
SHELL*:=/bin/sh 
SHELLFLAGS*:=-ce

all .SETDIR=/cygdrive/d/temp :
	+echo "PWD:$(PWD):"
	+echo "MAKEDIR:$(MAKEDIR):"
	+echo "TMD:$(TMD):"
- - - snip - - -
or
- - - snip - - -
SHELL*:=/bin/sh 
SHELLFLAGS*:=-ce

all ".SETDIR=test dir" :
	+echo "PWD:$(PWD):"
	+echo "MAKEDIR:$(MAKEDIR):"
	+echo "TMD:$(TMD):"
- - - snip - - -

test with:
$ dmake.exe -r
Comment 1 quetschke 2006-01-26 02:43:22 UTC
Created attachment 33565 [details]
Patch for dmake/
Comment 2 quetschke 2006-01-26 02:55:52 UTC
Committed to dmake43p1. Testcase is pending ...
Comment 3 quetschke 2006-01-27 01:34:23 UTC
Committed testcase and micro optimization to dmake43p01.

TMD was also verified to work when dmake is build as a native w32 binary.
Comment 4 quetschke 2006-01-27 01:35:08 UTC
ause: Please verify!
Comment 5 quetschke 2006-02-03 19:05:38 UTC
Regression testing by Steve found an inconsistency.

The old $(TMD) results always had a trailing slash / after .. but no slash after
real directory names.

The current implementation never has a trailing slash (this breaks the main
dmake bootstrap makefile dmake/makefile.mk) but also points out a problem:

You cannot use $(TMD)/somefile as this results in the absolute path /somefile
if $(PWD)=$(MAKEDIR). Always adding a slash if $(TMD)!="" is an option but not
consistent with the path representation in PWD or MAKEDIR.

Solution: Set TMD=. if $(PWD)=$(MAKEDIR).
Comment 6 quetschke 2006-02-03 19:46:58 UTC
Created attachment 33829 [details]
Patch for dmake/
Comment 7 quetschke 2006-02-03 19:47:51 UTC
Committed to dmake43p01.

@shay: Can you please verify?
Comment 8 shay 2006-02-06 09:44:21 UTC
Yep, works for me.  I tried using dmake to (re)build itself (which is what was
originally failing) and now it works fine.  I've also tried out a few other perl
related things (perl itself, plus several CPAN modules) and they're all building
without error.
Comment 9 hjs 2006-04-07 15:56:40 UTC
.
Comment 10 hjs 2006-04-21 17:29:12 UTC
.