module

Hace::MakefileConverter

Converts basic GNU Makefiles into Hacefile.yml content.

Supported subset:

  • rules with prerequisites and tab-indented recipes
  • multiple targets per rule (become multiple outputs)
  • variables (=, :=, ::=, ?=, +=), with $(NAME) / ${NAME} references. Variable values are resolved eagerly (make's "undefined means empty" semantics apply, and recursive variables must be defined before use).
  • export VAR=value becomes an env: entry
  • a SHELL variable becomes the Hacefile shell: setting
  • .PHONY and .DEFAULT_GOAL
  • automatic variables: $@ $< $^ $? $* and $$ escaping
  • pattern rules ("%.o: %.c"), emitted into a patterns: section

Anything else (conditionals, functions like $(wildcard), include, target-specific variables, static pattern rules, ...) produces a warning and is skipped; conversion never aborts because of unsupported constructs.

Constants

MAKEFILE_NAMES = ["Makefile", "makefile", "GNUmakefile"] of ::String

Basenames that identify a Makefile for runtime detection.

Instance methods

convert(content : String) : String

Convert Makefile content into Hacefile.yml content.

Source
looks_like_makefile?(filename : String) : Bool
Source