Skip to content

Assignment to automatic variables #119

Description

@cspiel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions