Update Makefile and add config.mk

This commit is contained in:
Alexander Rosenberg 2023-09-09 02:11:00 -07:00
parent 89073bf8bd
commit 316e32a6a5
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730
2 changed files with 17 additions and 17 deletions

View File

@ -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 $@

14
config.mk Normal file
View File

@ -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