This commit is contained in:
2026-08-16 11:52:05 +08:00
parent cc0dbb0cad
commit c6f4023768
3 changed files with 263 additions and 138 deletions
+5 -2
View File
@@ -7,7 +7,10 @@ DOCDIR ?= $(PREFIX)/share/doc/sfm
CXX ?= g++
CXXFLAGS ?= -std=c++17 -O2 -Wall -Wextra
LDFLAGS ?= -lncursesw
# Pick a curses library: prefer ncursesw, fall back to ncurses, then plain
# curses (netbsd-curses and BSD base systems provide only libcurses).
CURSES_LIBS ?= $(shell pkg-config --libs ncursesw 2>/dev/null || pkg-config --libs ncurses 2>/dev/null || echo -lcurses)
LDLIBS ?= $(CURSES_LIBS)
INSTALL ?= install
RM ?= rm -f
@@ -17,7 +20,7 @@ RM ?= rm -f
all: sfm
sfm: sfm.cpp
$(CXX) $(CXXFLAGS) -o $@ $< $(LDFLAGS)
$(CXX) $(CXXFLAGS) -o $@ $< $(LDLIBS)
install: all
@echo "Installing sfm to $(DESTDIR)$(BINDIR)/sfm ..."