I am using different environment variables for each compiler in my bash profile. I then import the respective variable in the respective tup variant and assign it to a variable I call COMPILER. That $(COMPILER) variable is then used in the rule. This way, each variant can create complete custom setups, including compiler options, etc. for each platform I am building.
So, for example, for OSX, it will look like this...
ifdef OSX
import PROJECT_OSX_COMPILER=gcc
COMPILER = $(PROJECT_OSX_COMPILER)
CFLAGS += -fdiagnostics-color=always
CFLAGS += -mmacosx-version-min=10.13
endif
For Windows, for example, it will then look like this
ifdef WIN32
import PROJECT_WIN32_COMPILER=clang
import PROJECT_WIN32_SYSTEM_INCLUDE
COMPILER = $(PROJECT_WIN32_COMPILER)
OUTNAME = libogg.lib
CFLAGS += -target x86_64-pc-win32
CFLAGS += -fdeclspec
CFLAGS += -D_CRT_SECURE_NO_WARNINGS
CFLAGS += -D_CRT_NONSTDC_NO_DEPRECATE
CFLAGS += -DWIN32_LEAN_AND_MEAN
CFLAGS += -isystem "$(PROJECT_WIN32_SYSTEM_INCLUDE)"
endif
and so on...
This is not exactly what you're asking but, perhaps, it will give you an idea for a different approach.
Guido