Fix build on OpenBSD - tty-clock - port of tty-clock to OpenBSD, with pledge/unveil added as goodie.
HTML git clone https://git.drkhsh.at/tty-clock.git
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 7553466db772b5e8862898ff95d87f872f040c35
DIR parent f2f847cf2cc2949c8a8b7779a778f366d3743474
HTML Author: drkhsh <me@drkhsh.at>
Date: Sat, 20 May 2023 01:15:33 +0200
Fix build on OpenBSD
Diffstat:
M Makefile | 23 ++++-------------------
1 file changed, 4 insertions(+), 19 deletions(-)
---
DIR diff --git a/Makefile b/Makefile
@@ -2,32 +2,17 @@
#Under BSD License
#See clock.c for the license detail.
-SRC = ttyclock.c ttyclock.h
+SRC = ttyclock.c
CC ?= gcc
BIN ?= tty-clock
PREFIX ?= /usr/local
INSTALLPATH ?= ${DESTDIR}${PREFIX}/bin
MANPATH ?= ${DESTDIR}${PREFIX}/share/man/man1
-ifeq ($(shell sh -c 'which ncurses6-config>/dev/null 2>/dev/null && echo y'), y)
- CFLAGS += -Wall -g $$(ncurses6-config --cflags)
- LDFLAGS += $$(ncurses6-config --libs)
-else ifeq ($(shell sh -c 'which ncursesw6-config>/dev/null 2>/dev/null && echo y'), y)
- CFLAGS += -Wall -g $$(ncursesw6-config --cflags)
- LDFLAGS += $$(ncursesw6-config --libs)
-else ifeq ($(shell sh -c 'which ncurses5-config>/dev/null 2>/dev/null && echo y'), y)
- CFLAGS += -Wall -g $$(ncurses5-config --cflags)
- LDFLAGS += $$(ncurses5-config --libs)
-else ifeq ($(shell sh -c 'which ncursesw5-config>/dev/null 2>/dev/null && echo y'), y)
- CFLAGS += -Wall -g $$(ncursesw5-config --cflags)
- LDFLAGS += $$(ncursesw5-config --libs)
-else
- CFLAGS += -Wall -g $$(pkg-config --cflags ncurses)
- LDFLAGS += $$(pkg-config --libs ncurses)
-endif
+CFLAGS += -Wall -g
+LDFLAGS += -lncurses
tty-clock : ${SRC}
-
@echo "building ${SRC}"
${CC} ${CFLAGS} ${SRC} -o ${BIN} ${LDFLAGS}
@@ -35,7 +20,7 @@ install : ${BIN}
@echo "installing binary file to ${INSTALLPATH}/${BIN}"
@mkdir -p ${INSTALLPATH}
- @cp ${BIN} ${INSTALLPATH}
+ @cp -f ${BIN} ${INSTALLPATH}
@chmod 0755 ${INSTALLPATH}/${BIN}
@echo "installing manpage to ${MANPATH}/${BIN}.1"
@mkdir -p ${MANPATH}