logo

utils

~/.local/bin tools and git-hooks git clone https://hacktivis.me/git/utils.git
commit: ba6a776b7aa41be52a46bd59b40f34bcedd4d02f
parent 9c34d08d7a175851060e8211c5b17184efb21e08
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Mon,  5 Apr 2021 05:29:29 +0200

Add -lm only when required

Diffstat:

MMakefile.common2+-
Mbin/Makefile6++++++
2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/Makefile.common b/Makefile.common @@ -25,7 +25,7 @@ Makefile.config: test: $(EXE_test) .c: - $(CC) -std=c11 $(CFLAGS) $(LDFLAGS) -o $@ $< -lm + $(CC) -std=c11 $(CFLAGS) -o $@ $< $(LDFLAGS) .c.o: $(CC) -std=c11 $(CFLAGS) -c -o $@ $< diff --git a/bin/Makefile b/bin/Makefile @@ -9,6 +9,12 @@ include ../Makefile.common BINDIR = $(PREFIX)/bin MANDIR = $(PREFIX)/share/man +lolcat: lolcat.c Makefile + $(CC) -std=c11 $(CFLAGS) -o $@ $< -lm $(LDFLAGS) + +xcd: xcd.c Makefile + $(CC) -std=c11 $(CFLAGS) -o $@ $< -lm $(LDFLAGS) + install: mkdir -p ${DESTDIR}${BINDIR}/ cp -p ${EXE} ${DESTDIR}${BINDIR}/