Skip to content

Commit

Permalink
Merge pull request torrinfail#48 from anntnzrb/patch-makefile
Browse files Browse the repository at this point in the history
Makefile tweaks
These changes are all pretty good. And I'm all for making it easier to build on the BSDs!
  • Loading branch information
torrinfail authored Jan 7, 2022
2 parents ba866be + adb7a49 commit a933ce0
Showing 1 changed file with 29 additions and 10 deletions.
39 changes: 29 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a933ce0

Please sign in to comment.