'Can this simple Makefile support cross-compilation?

I have a very simple Makefile:

override CFLAGS+=-Wall -g
OBJS=myobj.o

all: mymain

mymain: $(OBJS)

myobj.o: myheader1.h myheader2.h

It works perfectly on a target system, but can I somehow pass it some arguments to not compile with gcc but with mypreferred-gcc?

Or I have to introduce some extra CC parameters and I have to build the compilation line in the Makefile to do this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source