summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2023-10-21 12:29:43 -0400
committerZach DeCook <zachdecook@librem.one>2023-10-21 12:29:43 -0400
commitf6779d13690680bef9511ebfc160a8b85f8c9e32 (patch)
tree7440240d5f91a390d9e92e91cec6b1c30036cf78 /Makefile
parent3bf826317826a02772987e6c00a7f75d85e5b1d3 (diff)
downloadswipeGuess-f6779d13690680bef9511ebfc160a8b85f8c9e32.tar.gz
Makefile: Create example english word file
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 12 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index f9ed3b6..8dc42f0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 PREFIX?=/usr/local
 
-all: swipeGuess mapScore docs
+all: swipeGuess mapScore docs words-qwerty-en
 swipeGuess: swipeGuess.c
 	$(CC) swipeGuess.c -o swipeGuess
 mapScore: mapScore.c
@@ -11,13 +11,20 @@ swipeGuess.1: swipeGuess.1.scd
 mapScore.1: mapScore.1.scd
 	scdoc < mapScore.1.scd > mapScore.1
 
+words-qwerty-en: /usr/share/dict/american-english mapScore
+	grep ..  /usr/share/dict/american-english | ./mapScore map.qwerty.noapos.tsv bee  | sort -nr | cut -f2 > words-qwerty-en
+/usr/share/dict/american-english:
+	apk add words-en
+
 install: all
-	install -m755 swipeGuess -t "$(DESTDIR)/$(PREFIX)/bin/"
-	install -m755 mapScore -t "$(DESTDIR)/$(PREFIX)/bin/"
-	install -m644 swipeGuess.1 -t "$(DESTDIR)/$(PREFIX)/share/man/man1/"
-	install -m644 mapScore.1 -t "$(DESTDIR)/$(PREFIX)/share/man/man1/"
+	install -m755 swipeGuess -D -t "$(DESTDIR)/$(PREFIX)/bin/"
+	install -m755 mapScore -D -t "$(DESTDIR)/$(PREFIX)/bin/"
+	install -m644 swipeGuess.1 -D -t "$(DESTDIR)/$(PREFIX)/share/man/man1/"
+	install -m644 mapScore.1 -D -t "$(DESTDIR)/$(PREFIX)/share/man/man1/"
+	install -m644 words-qwerty-en -D -t "$(DESTDIR)/$(PREFIX)/share/swipeGuess/words/"
 uninstall:
 	rm -f "$(DESTDIR)/$(PREFIX)/bin/swipeGuess"
 	rm -f "$(DESTDIR)/$(PREFIX)/bin/mapScore"
 	rm -f "$(DESTDIR)/$(PREFIX)/share/man/man1/swipeGuess.1"
 	rm -f "$(DESTDIR)/$(PREFIX)/share/man/man1/mapScore.1"
+	rm -f "$(DESTDIR)/$(PREFIX)/share/swipeGuess/words/words-qwerty-en"