summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <git@jaseg.net>2021-01-16 13:21:32 +0100
committerjaseg <git@jaseg.net>2021-01-16 13:21:53 +0100
commit0039b3f8327960de697a08ebdf88e947a6a482dd (patch)
tree8be1d29764b8fc0261f7b4e8b28bae11b11a4a39
parenta1dfac8cf45decc99d1a0f6f86a52f65baf96506 (diff)
downloadlolcat-0039b3f8327960de697a08ebdf88e947a6a482dd.tar.gz
lolcat-0039b3f8327960de697a08ebdf88e947a6a482dd.tar.bz2
lolcat-0039b3f8327960de697a08ebdf88e947a6a482dd.zip
Fix linker argument order (fixes #36)
Thanks @elig0n !
-rw-r--r--Makefile7
1 files changed, 4 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 2c0277f..316c9b8 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,8 @@
CC ?= gcc
LOLCAT_SRC ?= lolcat.c
CENSOR_SRC ?= censor.c
-CFLAGS ?= -std=c11 -Wall -Wextra -O3 -Wno-sign-compare -lm
+CFLAGS ?= -std=c11 -Wall -Wextra -O3 -Wno-sign-compare
+LIBS := -lm
DESTDIR ?= /usr/local/bin
@@ -14,10 +15,10 @@ debug: all
.PHONY: install clean debug
lolcat: $(LOLCAT_SRC)
- $(CC) $(CFLAGS) -o $@ $^
+ $(CC) $(CFLAGS) -o $@ $^ $(LIBS)
censor: $(CENSOR_SRC)
- $(CC) $(CFLAGS) -o $@ $^
+ $(CC) $(CFLAGS) -o $@ $^ $(LIBS)
install: lolcat censor
install lolcat $(DESTDIR)/lolcat