Config.mk: Add COMPILEZIG

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
Huang Qi 2022-09-09 10:34:09 +00:00 committed by Xiang Xiao
parent 644c4afeed
commit d7b04a2b8b
1 changed files with 18 additions and 0 deletions

View File

@ -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
#
# '<filename>.zig_ZIGFLAGS += <options>' may also be used, as an example, to
# change the options used with the single file <filename>.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)
#