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