diff --git a/tools/Config.mk b/tools/Config.mk index 41699176c07..8148b3a0442 100644 --- a/tools/Config.mk +++ b/tools/Config.mk @@ -312,6 +312,24 @@ define COMPILERUST $(Q) $(RUSTC) --emit obj $(RUSTFLAGS) $($(strip $1)_RUSTFLAGS) $1 -o $2 endef +# COMPILEZIG - Default macro to compile one Zig file +# Example: $(call COMPILEZIG, in-file, out-file) +# +# Depends on these settings defined in board-specific Make.defs file +# installed at $(TOPDIR)/Make.defs: +# +# ZIG - The command to invoke the Zig compiler +# ZIGFLAGS - Options to pass to the Zig compiler +# +# '.zig_ZIGFLAGS += ' may also be used, as an example, to +# change the options used with the single file .zig. The same +# applies mutatis mutandis. + +define COMPILEZIG + @echo "ZIG: $1" + $(Q) $(ZIG) build-obj $(ZIGFLAGS) $($(strip $1)_ZIGFLAGS) --name $(basename $2) $1 +endef + # ASSEMBLE - Default macro to assemble one assembly language file # Example: $(call ASSEMBLE, in-file, out-file) #