mk: add golang as target for compilation

Fixes #4358
This commit is contained in:
Alexander Tormasov 2021-06-06 15:49:57 +03:00 committed by Christian Helmuth
parent 507e5ac776
commit b3f8b49873
2 changed files with 10 additions and 1 deletions

View File

@ -7,7 +7,7 @@
# Collect object files and avoid duplicates (by using 'sort')
#
SRC_O += $(addprefix binary_,$(addsuffix .o,$(notdir $(SRC_BIN))))
SRC = $(sort $(SRC_C) $(SRC_CC) $(SRC_ADB) $(SRC_ADS) $(SRC_RS) $(SRC_S) $(SRC_O))
SRC = $(sort $(SRC_C) $(SRC_CC) $(SRC_ADB) $(SRC_ADS) $(SRC_RS) $(SRC_S) $(SRC_O) $(SRC_GO))
OBJECTS = $(addsuffix .o,$(basename $(SRC)))
#
@ -69,6 +69,13 @@ endif
$(MSG_ASSEM)$@
$(VERBOSE)$(CC) $(CC_DEF) $(CC_C_OPT) $(INCLUDES) -c $< -o $@
#
# Compiling Go sources
#
%.o: %.go
$(MSG_COMP)$@
$(VERBOSE)$(GOLANG) $(CUSTOM_GO_FLAGS) -c -o $@ $<
#
# Compiling Ada source codes
#

View File

@ -27,6 +27,7 @@ CUSTOM_HOST_CC ?= $(HOST_DEV_PREFIX)gcc
CUSTOM_HOST_CXX ?= $(HOST_DEV_PREFIX)g++
CUSTOM_ADA_CC ?= $(CUSTOM_CC)
CUSTOM_ALI2DEP ?= $(CROSS_DEV_PREFIX)ali2dep
CUSTOM_GO ?= $(CROSS_DEV_PREFIX)gccgo
#
# GNU utilities
@ -56,6 +57,7 @@ GNATBIND = $(CUSTOM_GNATBIND)
HOST_CC = $(CUSTOM_HOST_CC)
ADA_CC = $(CUSTOM_ADA_CC)
ALI2DEP = $(CUSTOM_ALI2DEP)
GOLANG = $(CUSTOM_GO)
#
# Compiler and Linker options