Issue 65122 - multiple %-targets defined in tg_config.mk
Summary: multiple %-targets defined in tg_config.mk
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-05-05 19:07 UTC by quetschke
Modified: 2013-08-07 15:34 UTC (History)
2 users (show)

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


Attachments
Patch for dmake (19.10 KB, patch)
2006-05-05 22:30 UTC, quetschke
no flags Details | Diff
example makefile (177 bytes, patch)
2006-06-26 17:05 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-05-05 19:07:54 UTC
I started to tidy up the %-target handling in dmake45 and immediately stumbled
over tg_config.mk - line 103. Something like this:

bla{$(alllangiso)}$/$(PACKAGEDIR)$/%.properties :| blub$/%.xcs

This shouldn't work according to:

              <%-target> [<attributes>] <ruleop> [<%-prerequisites>] [;<recipe>]

       where %-target is a  target  containing  exactly  a  single  `%'  sign,
       attributes  is  a  list  (possibly  empty) of attributes, ruleop is the
       standard set of rule operators, %-prerequisites , if present, is a list
       of  prerequisites  containing  zero  or  more `%' signs, and recipe, if
       present, is the first line of the recipe.

and the :| operator definition doesn't help either.

But it works with the current 4.4 dmake (but only with the :| operator)
%.a %.b :| %.x ; recipe
is expanded to:
%.a : %.x ; recipe
%.b : %.x ; recipe

The :| still has problems with indirect prerequisites, see issue 48087, but
I think the "new" meaning of the :| operator should be:

Expand all targets / non-indirect prerequisite combinations and add the
indirect prerequisites to each target. Example:

%.a %.b :| %.x %.y 'Z' ; recipe
is expanded to:
%.a : %.x 'Z' ; recipe
%.b : %.x 'Z' ; recipe
%.a : %.y 'Z' ; recipe
%.b : %.y 'Z' ; recipe

This is nearly already the case with dmake 4.4 but the indirect prereq handling
is broken ATM.

Without the :| this fails currently and for consistency we should issue
an error if more than one %target is on one line without the :| operator.
Comment 1 quetschke 2006-05-05 22:30:05 UTC
Created attachment 36289 [details]
Patch for dmake
Comment 2 quetschke 2006-05-05 22:37:46 UTC
Committed to CWS dmake45 to get over the problem in tg_config.mk.

The indirect prereq handling is not yet fixed, and the manpage has to be changed
also.
Comment 3 quetschke 2006-06-13 19:34:18 UTC
The manpage got adapted in revision 1.6.2.3 of dmake.tf (issue 48087). The
indirect prerequisites handling got also fixed in that issue, although there
are problems left with multiple prerequisites.

Added a testcase.

Reassigning for verification.
Comment 4 quetschke 2006-06-13 19:34:42 UTC
@ause: Please verify.
Comment 5 hjs 2006-06-26 16:10:47 UTC
missing the error for

%.a %.b : %.c

case...
Comment 6 quetschke 2006-06-26 17:05:05 UTC
Hmmm?

$ ./dmake/dmake.exe -rf t65122_2.mk
dmake:  t65122_2.mk:  line 6:  Warning: -- Prior to dmake 4.5 only one
%-target per target-definition worked reliably. Check your makefiles.

with following makefile.
Comment 7 quetschke 2006-06-26 17:05:48 UTC
Created attachment 37330 [details]
example makefile
Comment 8 hjs 2006-06-26 18:55:41 UTC
i see. dependency got lost when using first %-target. works now.
this means verified
Comment 9 hjs 2006-07-07 15:24:17 UTC
.