summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortorrinfail <torrinfail@gmail.com>2022-01-06 20:08:50 -0700
committerGitHub <noreply@github.com>2022-01-06 20:08:50 -0700
commita933ce0d6109524b393feb3e7156cbf0de88b42c (patch)
treef614748684ef68373e5eb811785d45e2455fbcd2
parentba866be168ec676c7361360957c20ed9cef9e737 (diff)
parentadb7a49803346cf1c8a10e147c5e93a42bc10169 (diff)
Merge pull request #48 from anntnzrb/patch-makefileHEADmaster
Makefile tweaks These changes are all pretty good. And I'm all for making it easier to build on the BSDs!
-rw-r--r--Makefile39
1 files changed, 29 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index ef43ef4..75109ac 100644
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,36 @@
-PREFIX ?= /usr/local
-CC ?= cc
-LDFLAGS = -lX11
+PREFIX := /usr/local
+CC := cc
+CFLAGS := -pedantic -Wall -Wno-deprecated-declarations -Os
+LDFLAGS := -lX11
+
+# FreeBSD (uncomment)
+#LDFLAGS += -L/usr/local/lib -I/usr/local/include
+# # OpenBSD (uncomment)
+#LDFLAGS += -L/usr/X11R6/lib -I/usr/X11R6/include
+
+all: options dwmblocks
+
+options:
+ @echo dwmblocks build options:
+ @echo "CFLAGS = ${CFLAGS}"
+ @echo "LDFLAGS = ${LDFLAGS}"
+ @echo "CC = ${CC}"
+
+dwmblocks: dwmblocks.c blocks.def.h blocks.h
+ ${CC} -o dwmblocks dwmblocks.c ${CFLAGS} ${LDFLAGS}
-output: dwmblocks.c blocks.def.h blocks.h
- ${CC} dwmblocks.c $(LDFLAGS) -o dwmblocks
blocks.h:
cp blocks.def.h $@
-
clean:
rm -f *.o *.gch dwmblocks
-install: output
- mkdir -p $(DESTDIR)$(PREFIX)/bin
- install -m 0755 dwmblocks $(DESTDIR)$(PREFIX)/bin/dwmblocks
+
+install: dwmblocks
+ mkdir -p ${DESTDIR}${PREFIX}/bin
+ cp -f dwmblocks ${DESTDIR}${PREFIX}/bin
+ chmod 755 ${DESTDIR}${PREFIX}/bin/dwmblocks
+
uninstall:
- rm -f $(DESTDIR)$(PREFIX)/bin/dwmblocks
+ rm -f ${DESTDIR}${PREFIX}/bin/dwmblocks
+
+.PHONY: all options clean install uninstall