From 316e32a6a512ea7360a23b5b77c50b173c62f512 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Sat, 9 Sep 2023 02:11:00 -0700 Subject: [PATCH] Update Makefile and add config.mk --- Makefile | 20 +++----------------- config.mk | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 config.mk diff --git a/Makefile b/Makefile index 52b8e2d..0347a1e 100644 --- a/Makefile +++ b/Makefile @@ -1,30 +1,16 @@ -PREFIX := /usr/local -CC := cc -CFLAGS := -pedantic -Wall -Wno-deprecated-declarations -Os -LDFLAGS := -lX11 -PULSEFLAGS := -lpulse -NO_X := 0 - -ifeq ($(NO_X), 1) - CFLAGS := $(CFLAGS) -DNO_X -endif - -# FreeBSD (uncomment) -#LDFLAGS += -L/usr/local/lib -I/usr/local/include -# # OpenBSD (uncomment) -#LDFLAGS += -L/usr/X11R6/lib -I/usr/X11R6/include +include config.mk all: options dwmblocks options: @echo dwmblocks build options: - @echo "CFLAGS = ${CFLAGS}" + @echo "CFLAGS = ${CFLAGS} ${NO_X}" @echo "LDFLAGS = ${LDFLAGS}" @echo "CC = ${CC}" @echo "PULSEFLAGS = ${PULSEFLAGS}" dwmblocks: dwmblocks.c pulse-listener.c blocks.def.h blocks.h - ${CC} -o dwmblocks dwmblocks.c pulse-listener.c ${CFLAGS} ${PULSEFLAGS} ${LDFLAGS} + ${CC} ${NO_X} -o dwmblocks dwmblocks.c pulse-listener.c ${CFLAGS} ${PULSEFLAGS} ${LDFLAGS} blocks.h: cp blocks.def.h $@ diff --git a/config.mk b/config.mk new file mode 100644 index 0000000..124c15e --- /dev/null +++ b/config.mk @@ -0,0 +1,14 @@ +PREFIX := /usr/local +CC := cc +CFLAGS := -pedantic -Wall -Wno-deprecated-declarations -Os +LDFLAGS := -lX11 +PULSEFLAGS := -lpulse + +NO_X = +# Uncomment to build without X11 +NO_X = -DNO_X + +# FreeBSD (uncomment) +#LDFLAGS += -L/usr/local/lib -I/usr/local/include +# # OpenBSD (uncomment) +#LDFLAGS += -L/usr/X11R6/lib -I/usr/X11R6/include