summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUwe Kleine-König <uwe@kleine-koenig.org>2019-01-31 10:07:24 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-02-01 00:57:38 +0100
commit36a74d33c6645b7bff5661f57dcaf48f1b6d1c60 (patch)
tree69745f236790c6d4e1e5e39bbd1a8fa0be58b839
parentdd98d9f9bbca464ce9a113e52040f31fa539fc31 (diff)
downloadsparse-36a74d33c6645b7bff5661f57dcaf48f1b6d1c60.tar.gz
Makefile: default to LD = CC
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>
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 9c4bafff..025bce29 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