From 6be2a10558f8df9545a79f89a6a9cb40ea7ca6a7 Mon Sep 17 00:00:00 2001 From: anntnzrb Date: Fri, 28 May 2021 11:36:37 -0500 Subject: [PATCH 1/2] Makefile tweaks Modified according to [dwm](http://git.suckless.org/dwm/file/Makefile.html) 's Makefile file. --- Makefile | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index ef43ef4..4edfc39 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,31 @@ -PREFIX ?= /usr/local -CC ?= cc +PREFIX ?= /usr/local +CC ?= cc +CFLAGS = -pedantic -Wall -Wno-deprecated-declarations -Os LDFLAGS = -lX11 -output: dwmblocks.c blocks.def.h blocks.h - ${CC} dwmblocks.c $(LDFLAGS) -o dwmblocks +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} + 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 + ${RM} *.o *.gch 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} ${DESTDIR}${PREFIX}/bin/dwmblocks + +.PHONY: all options clean install uninstall From adb7a49803346cf1c8a10e147c5e93a42bc10169 Mon Sep 17 00:00:00 2001 From: anntnzrb Date: Thu, 5 Aug 2021 07:55:45 -0500 Subject: [PATCH 2/2] Added {Free,Open}BSD support | minor edits --- Makefile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 4edfc39..75109ac 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,12 @@ -PREFIX ?= /usr/local -CC ?= cc -CFLAGS = -pedantic -Wall -Wno-deprecated-declarations -Os -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 @@ -18,7 +23,7 @@ blocks.h: cp blocks.def.h $@ clean: - ${RM} *.o *.gch dwmblocks + rm -f *.o *.gch dwmblocks install: dwmblocks mkdir -p ${DESTDIR}${PREFIX}/bin @@ -26,6 +31,6 @@ install: dwmblocks chmod 755 ${DESTDIR}${PREFIX}/bin/dwmblocks uninstall: - ${RM} ${DESTDIR}${PREFIX}/bin/dwmblocks + rm -f ${DESTDIR}${PREFIX}/bin/dwmblocks .PHONY: all options clean install uninstall