diff --git a/repos/base/mk/generic.mk b/repos/base/mk/generic.mk index 66e5c309c4..599e4839a5 100644 --- a/repos/base/mk/generic.mk +++ b/repos/base/mk/generic.mk @@ -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 # diff --git a/repos/base/mk/global.mk b/repos/base/mk/global.mk index 34ce4d9f86..b614ab7282 100644 --- a/repos/base/mk/global.mk +++ b/repos/base/mk/global.mk @@ -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