Usually the compiler is used as linker. Assuming that if someone wants to change the compiler the linker should be changed, too, simplify that use case by using "$(CC)" as linker instead of the hard coded "gcc". This also matches the behaviour of make when using the built-in rules of GNU Make which include: LINK.o = $(CC) $(LDFLAGS) $(TARGET_ARCH) %: %.o $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@ Signed-off-by: Uwe Kleine-König <uwe@xxxxxxxxxxxxxxxxx> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9c4bafffcd6e..025bce296cdf 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ OS = linux CC = gcc CFLAGS = -O2 -g CFLAGS += -Wall -Wwrite-strings -LD = gcc +LD = $(CC) AR = ar PKG_CONFIG = pkg-config CHECKER = CHECK=./sparse ./cgcc -no-compile -- 2.20.1