shithub: moonfish

Download patch

ref: e0986d0fbef869b5d2fc13bd135d8950ce7b4d37
parent: 1f124ecfd86cc9be10f83cd1e3a228a28278b8d3
author: zamfofex <zamfofex@twdb.moe>
date: Sat Dec 16 08:56:39 EST 2023

add ’install’ target

--- a/makefile
+++ b/makefile
@@ -2,6 +2,8 @@
 # copyright 2023 zamfofex
 
 CFLAGS ?= -ansi -O3 -Wall -Wextra -Wpedantic
+PREFIX ?= /usr/local
+BINDIR ?= $PREFIX/bin
 
 cc := $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
 
@@ -10,7 +12,7 @@
 moonfish_cc := $(cc) -pthread -D_POSIX_C_SOURCE=199309L
 tools_cc := $(cc) -pthread -D_POSIX_C_SOURCE=200809L
 
-.PHONY: all clean
+.PHONY: all clean install
 
 all: moonfish play lichess analyse
 
@@ -29,3 +31,9 @@
 clean:
 	$(RM) moonfish moonfish.exe play lichess analyse
 	$(RM) moonfish.c moonfish.c.xz moonfish.sh
+
+install: all
+	install -m 755 moonfish $BINDIR/moonfish
+	install -m 755 play $BINDIR/moonfish-play
+	install -m 755 lichess $BINDIR/moonfish-lichess
+	install -m 755 analyse $BINDIR/moonfish-analyse
--