1
0
Fork 0
forked from murx/murx
murx/Makefile

46 lines
1,016 B
Makefile
Raw Normal View History

2026-10-29 18:12:51 +01:00
CC ?= cc
CFLAGS ?= -O2
CFLAGS += -std=c99 -Wall -Wextra
PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin
2026-11-16 01:23:23 +01:00
MANDIR ?= $(PREFIX)/share/man
2026-10-29 18:12:51 +01:00
# 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
2026-10-29 18:12:51 +01:00
murx: murx.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ murx.c $(LDLIBS) `$(PTY_LIB_SH)`
2026-10-29 18:12:51 +01:00
install: murx murx.1
2026-11-16 01:23:23 +01:00
install -d "$(DESTDIR)$(BINDIR)" "$(DESTDIR)$(MANDIR)/man1"
install -m 755 murx "$(DESTDIR)$(BINDIR)/murx"
install -m 644 murx.1 "$(DESTDIR)$(MANDIR)/man1/murx.1"
2026-10-29 18:12:51 +01:00
uninstall:
rm -f "$(DESTDIR)$(BINDIR)/murx"
rm -f "$(DESTDIR)$(MANDIR)/man1/murx.1"
2026-10-29 18:12:51 +01:00
clean:
rm -f murx
2026-10-29 18:12:51 +01:00
pkgclean:
rm -rf *.apk
rm -rf *.xz
2026-11-19 11:29:34 +01:00
pkgalpine: pkgclean
abuild checksum
abuild -r
pkgarch: pkgclean
updpkgsums
makepkg
pkgsums:
abuild checksum
updpkgsums
.PHONY: all install uninstall clean pkgclean pkgalpine pkgarch pkgsums