Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gyp's Makefile generator can't handle RULE_INPUT_NAME as output for a rule #486

Open
GoogleCodeExporter opened this issue Jul 27, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

Something I found when testing in v8-standalone which uses gyp in Makefile mode:

If you have a target

        {
            'target_name': 'icu_cnv_base_files',
            'type': 'none',
            'sources': [
                'foo.nrm', 'bar.nrm', 'fie.nrm',
            ],
            'rules': [
                {
                    'rule_name': 'icupkg_nrm',
                    'extension': 'nrm',
                    'outputs': [
                        '<(icu_gen_dir)/<(RULE_INPUT_NAME)',
                    ],
                },
            ],


You get a Makefile with the style:

$icu_gen_dir/$(notdir $<): foo.nrm:
    cmd
...
$icu_gen_dir/$(notdir $<): bar.nrm:
    cmd
...
$icu_gen_dir/$(notdir $<): fie.nrm:
    cmd

$(notdir $<) is supposed to expand to the name of the first prerequisite of a 
target but at least in Make 3.81 (xubuntu 14.10) $< expands to nothing and you 
get warnings about "overriding commands fr target" and "ignoring old commands 
for target" followed by targets that are never executed. 

$< It's often used in commands, so it's possible it was never meant to work in 
a target.

This is implemented in gyp in gyp/pylib/gyp/generator/make.py where 
RULE_INPUT_NAME is an output and is expanded to be the target through an 
explicit expansion to $(notdir $<).

A fix would probably be to do something similar as is already done for 
RULE_INPUT_ROOT and RULE_INPUT_DIRNAME.

I will workaround this in my bug 424192 work since gyp and Make are both 
supposed to go away, but I'm leaving this bug here for reference.

Originally reported as 
https://code.google.com/p/chromium/issues/detail?id=472589 in the Chromium 
project.

Original issue reported on code.google.com by brat...@opera.com on 14 Apr 2015 at 1:17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant