Skip to content

Commit

Permalink
Makefile: default to LD = CC
Browse files Browse the repository at this point in the history
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@kleine-koenig.org>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
  • Loading branch information
ukleinek authored and lucvoo committed Jan 31, 2019
1 parent dd98d9f commit 36a74d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 36a74d3

Please sign in to comment.