diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-02-09 10:19:46 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-02-09 10:19:46 +0900 |
| commit | b9d337f3c0ca2501744a1bb12b9bd6d3929c692c (patch) | |
| tree | dd312fea6046764464b93cb3464b9b260bb3062f /dwmblocks | |
| parent | 0bbc6ee96491c8f9619148018214427d8ca026b4 (diff) | |
updates
Diffstat (limited to 'dwmblocks')
| -rw-r--r-- | dwmblocks/Makefile | 41 | ||||
| -rw-r--r-- | dwmblocks/config.def.h (renamed from dwmblocks/config.h) | 0 | ||||
| -rw-r--r-- | dwmblocks/dwmblocks.c | 2 |
3 files changed, 30 insertions, 13 deletions
diff --git a/dwmblocks/Makefile b/dwmblocks/Makefile index 5cfbb5a..159a71a 100644 --- a/dwmblocks/Makefile +++ b/dwmblocks/Makefile @@ -1,19 +1,36 @@ -.POSIX: +PREFIX := /usr/local +CC := cc +CFLAGS := -pedantic -Wall -Wno-deprecated-declarations -Os +LDFLAGS := -lX11 -PREFIX = /usr/local -CC = gcc +# 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 config.def.h config.h + ${CC} -o dwmblocks dwmblocks.c ${CFLAGS} ${LDFLAGS} + +config.h: + cp config.def.h $@ -dwmblocks: dwmblocks.o - $(CC) dwmblocks.o -lX11 -o dwmblocks -dwmblocks.o: dwmblocks.c config.h - $(CC) -c dwmblocks.c clean: rm -f *.o *.gch dwmblocks + install: dwmblocks - mkdir -p $(DESTDIR)$(PREFIX)/bin - cp -f dwmblocks $(DESTDIR)$(PREFIX)/bin - chmod 755 $(DESTDIR)$(PREFIX)/bin/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: clean install uninstall +.PHONY: all options clean install uninstall diff --git a/dwmblocks/config.h b/dwmblocks/config.def.h index 6726613..6726613 100644 --- a/dwmblocks/config.h +++ b/dwmblocks/config.def.h diff --git a/dwmblocks/dwmblocks.c b/dwmblocks/dwmblocks.c index 36b6a9a..1bd87f0 100644 --- a/dwmblocks/dwmblocks.c +++ b/dwmblocks/dwmblocks.c @@ -251,7 +251,7 @@ void sighandler() void buttonhandler(int ssi_int) { - char button[2] = {'0' + ssi_int & 0xff, '\0'}; + char button[2] = {('0' + ssi_int) & 0xff, '\0'}; pid_t process_id = getpid(); int sig = ssi_int >> 8; if (fork() == 0) |
