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

Assignment to automatic variables #119

Open
cspiel opened this issue Jun 4, 2019 · 0 comments
Open

Assignment to automatic variables #119

cspiel opened this issue Jun 4, 2019 · 0 comments

Comments

@cspiel
Copy link
Collaborator

cspiel commented Jun 4, 2019

OMake parses only one of the automatic
variables, when used in assigment namely @.
However, all others (&, *, +, <, >,
and ^) are un-assignable.

public.@ = target               # OK!

public.& = free-vals            # syntax error: parse error
public.* = stem                 # Failure: .public*: bad match
public.+ = all-deps-unsorted    # command not found in PATH: .public+
public.< = first-dep            # syntax error: parse error
public.> = no-suffix-target     # syntax error: parse error
public.^ = all-deps-sorted      # command not found in PATH: .public^

We can workaround the absence of assigning to public.*,
though as "$(public.*) == $(removesuffix $(public.@))"
holds.

Assigment is necessary as soon a any of
these variables must be expanded outside of a
rule body, e.g. for logging, printing, or just
viewing. Now print OPTIMIZATION_FLAGS, when
part of its definition reads

OPTIMIZATION_FLAGS += -fopt-info-optall=$`(removesuffix $(public.@)).opt-info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant