From f67807d3483aef73e9d860a38e86a0c019ba7ae1 Mon Sep 17 00:00:00 2001 From: ryanm0 Date: Tue, 4 Aug 2020 23:16:36 -1000 Subject: Makefile: fix "output" target name Without the right target name, make will rebuild the target (dwmblocks) every time make is run, even if the source files haven't changed. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c2c3c6b..efd2104 100644 --- a/Makefile +++ b/Makefile @@ -2,13 +2,13 @@ PREFIX = /usr/local -output: dwmblocks.o +dwmblocks: dwmblocks.o gcc dwmblocks.o -lX11 -o dwmblocks dwmblocks.o: dwmblocks.c config.h gcc -c -lX11 dwmblocks.c clean: rm -f *.o *.gch dwmblocks -install: output +install: dwmblocks mkdir -p $(DESTDIR)$(PREFIX)/bin cp -f dwmblocks $(DESTDIR)$(PREFIX)/bin chmod 755 $(DESTDIR)$(PREFIX)/bin/dwmblocks -- cgit v1.2.3-13-gbd6f From 841a60783024d882e3dad3713f08712a9deae09e Mon Sep 17 00:00:00 2001 From: ryanm0 Date: Tue, 4 Aug 2020 23:19:06 -1000 Subject: Makefile: use $(CC) instead of hardcoding gcc --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index efd2104..5cfbb5a 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,12 @@ .POSIX: PREFIX = /usr/local +CC = gcc dwmblocks: dwmblocks.o - gcc dwmblocks.o -lX11 -o dwmblocks + $(CC) dwmblocks.o -lX11 -o dwmblocks dwmblocks.o: dwmblocks.c config.h - gcc -c -lX11 dwmblocks.c + $(CC) -c dwmblocks.c clean: rm -f *.o *.gch dwmblocks install: dwmblocks -- cgit v1.2.3-13-gbd6f