commit 49219863567dbb3b4eeccf8f007a24deb8463e70
parent abba8b2e9ea0b7cf89af3d3e6fdfa23c09cc73ad
Author: Andrew Laack <andrew@laack.co>
Date: Sat, 26 Sep 2026 09:22:25 -0500
Makefile refactor'
Diffstat:
3 files changed, 50 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile
@@ -1,25 +1,29 @@
+include config.mk
+
+debug:
+ ${DCOMMAND_P} src/main.cpp ${DCOMMAND_S} -o gem-browser.out
+
build:
- g++ -g src/main.cpp src/identity-manager.cpp src/quote.cpp src/list-item.cpp src/preformatted.cpp src/format-switch.cpp src/cache.cpp src/link.cpp src/plaintext.cpp src/site.cpp src/utils.cpp src/gemini-client.cpp src/browser.cpp src/heading.cpp -lssl -lcrypto -lncursesw -o browser.out
+ ${COMMAND_P} src/main.cpp ${COMMAND_S} -o gem-browser.out
-install:
- g++ -Ofast src/main.cpp src/identity-manager.cpp src/quote.cpp src/list-item.cpp src/preformatted.cpp src/format-switch.cpp src/cache.cpp src/link.cpp src/plaintext.cpp src/site.cpp src/utils.cpp src/gemini-client.cpp src/browser.cpp src/heading.cpp -lssl -lcrypto -lncursesw -o browser.out
- cp browser.out /usr/local/bin/gem-browser
+install: build
+ cp gem-browser.out ${PREFIX}/bin/gem-browser
clean:
echo "Not implemented"
browser-test:
- g++ tests/browser-test.cpp src/quote.cpp src/identity-manager.cpp src/list-item.cpp src/preformatted.cpp src/format-switch.cpp src/heading.cpp src/cache.cpp src/plaintext.cpp src/browser.cpp src/link.cpp src/site.cpp src/utils.cpp src/gemini-client.cpp -lCatch2Main -lCatch2 -lssl -lcrypto -o test.out
+ ${TCOMMAND_P} tests/browser-test.cpp ${TCOMMAND_S} -o test.out
./test.out
rm test.out
fetch-test:
- g++ tests/fetch-test.cpp src/quote.cpp src/identity-manager.cpp src/list-item.cpp src/link.cpp src/preformatted.cpp src/format-switch.cpp src/heading.cpp src/cache.cpp src/site.cpp src/plaintext.cpp src/utils.cpp src/gemini-client.cpp -lCatch2Main -lCatch2 -lssl -lcrypto -o test.out
+ ${TCOMMAND_P} tests/fetch-test.cpp ${TCOMMAND_S} -o test.out
./test.out
rm test.out
pure-test:
- g++ tests/pure-test.cpp src/quote.cpp src/list-item.cpp src/identity-manager.cpp src/link.cpp src/preformatted.cpp src/format-switch.cpp src/heading.cpp src/cache.cpp src/site.cpp src/plaintext.cpp src/utils.cpp src/gemini-client.cpp -lCatch2Main -lCatch2 -lssl -lcrypto -o test.out
+ ${TCOMMAND_P} tests/pure-test.cpp ${TCOMMAND_S} -o test.out
./test.out
rm test.out
diff --git a/TODO.txt b/TODO.txt
@@ -47,3 +47,19 @@
- we shouldn't use prefetched when we add a cert where we didn't have one before.
- ability to go left / right in input box.
+- auto-follow redirects based on domain?
+ - A/y/n -- always, no, yes
+- hmm, does this not work with redirects from the cli?
+ - gem-browser gemini://larsthebear.me/
+ - (seems so... perhaps I was on the non-updated version.)
+
+---
+
+- is there a way to get a better name for a page
+ - perhaps heading is most recent h1? h2? h3?
+- downloading and interactions broadly should show more information
+ - reloading should have progress / indication
+ - perhaps I should just re-use the entry box for download (specify a file) / success type stuff?
+ - I'm wary to make it too interactive as that might draw focus away from the text being read.
+
+- bookmarks
diff --git a/config.mk b/config.mk
@@ -0,0 +1,23 @@
+VERSION = 10.0.0
+
+PREFIX = /usr/local
+MANPREFIX = ${PREFIX}/share/man
+
+LIBS = -lssl -lcrypto -lncursesw
+TLIBS = -lCatch2Main -lCatch2 ${LIBS}
+
+CC = g++
+
+IFLAGS = -Ofast -std=c++23
+DFLAGS = -O0 -fsanitize=address,undefined -g -std=c++23 -Wpedantic -Wall -Wextra -Wno-deprecated-declarations
+
+BASE_FILES = src/identity-manager.cpp src/quote.cpp src/list-item.cpp src/preformatted.cpp src/format-switch.cpp src/cache.cpp src/link.cpp src/plaintext.cpp src/site.cpp src/utils.cpp src/gemini-client.cpp src/browser.cpp src/heading.cpp
+
+COMMAND_P = ${CC} ${CFLAGS} -D NDEBUG
+COMMAND_S = ${BASE_FILES} ${LIBS}
+
+TCOMMAND_P = ${CC} ${CTFLAGS}
+TCOMMAND_S = ${BASE_FILES} ${TLIBS}
+
+DCOMMAND_P = ${CC} ${DFLAGS}
+DCOMMAND_S = ${BASE_FILES} ${LIBS}