1
0
Fork 0
forked from murx/murx

Use openpty for cross-platform pty setup and improve startup errors

This commit is contained in:
Armin 2026-11-19 12:49:57 +01:00
commit 2459c4559d
3 changed files with 59 additions and 37 deletions

View file

@ -5,10 +5,15 @@ PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man
# openpty(3) lives in libutil on the BSDs, but in libc on Linux and macOS
# (and in musl). Resolve it in the shell so this Makefile works with both
# GNU make and BSD make.
PTY_LIB_SH = uname -s | grep -Eq 'BSD|DragonFly' && echo -lutil
all: murx
murx: murx.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ murx.c $(LDLIBS)
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ murx.c $(LDLIBS) `$(PTY_LIB_SH)`
install: murx murx.1
install -d "$(DESTDIR)$(BINDIR)" "$(DESTDIR)$(MANDIR)/man1"