Add an integrity footer to chat.html, zebra-audio.html, and how-it-works.html showing the build date (2026-05-28) and the page's own MD5 + SHA-256. A file can't hold its own hash, so web/stamp.js (make stamp) computes the hashes with the two hash fields zeroed, then writes the real values back — self-consistent and idempotent. To verify a served page: blank the two fields and re-hash; confirmed it reproduces the stamped value with plain sha256sum.
67 lines
1.9 KiB
Makefile
67 lines
1.9 KiB
Makefile
CC = gcc
|
|
CFLAGS = -Wall -Wextra -O2 -Iinclude $(shell pkg-config --cflags libpulse)
|
|
LDFLAGS = $(shell pkg-config --libs libpulse) -lrt -lpthread
|
|
|
|
PULSE = src/pulse.c
|
|
|
|
.PHONY: all clean serve blog test test-all test-web stamp zebrad
|
|
|
|
# stamp each web page with today's date + its own md5/sha256 (run before deploy)
|
|
stamp:
|
|
@node web/stamp.js web/chat.html web/zebra-audio.html web/how-it-works.html
|
|
|
|
all: tx rx chat bt carrier zebrad
|
|
|
|
test: test/unit
|
|
@./test/unit
|
|
|
|
# web modem/protocol tests — pure Node, no browser or second device needed
|
|
test-web:
|
|
@node test/web-protocol.test.js
|
|
|
|
test-all: test/unit test/integration test/functional test-web
|
|
@echo "--- unit ---"
|
|
@./test/unit
|
|
@echo "--- integration ---"
|
|
@./test/integration
|
|
@echo "--- functional ---"
|
|
@./test/functional
|
|
@echo "--- web protocol ---"
|
|
@node test/web-protocol.test.js
|
|
|
|
test/unit: test/unit.c include/zebra.h include/modem.h test/test.h
|
|
$(CC) $(CFLAGS) -o $@ test/unit.c
|
|
|
|
test/integration: test/integration.c src/pulse.c include/zebra.h include/modem.h test/test.h
|
|
$(CC) $(CFLAGS) -o $@ test/integration.c src/pulse.c $(LDFLAGS)
|
|
|
|
test/functional: test/functional.c src/pulse.c include/zebra.h include/modem.h test/test.h
|
|
$(CC) $(CFLAGS) -o $@ test/functional.c src/pulse.c $(LDFLAGS)
|
|
|
|
tx: src/tx.c $(PULSE)
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
|
|
|
rx: src/rx.c $(PULSE)
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
|
|
|
chat: src/chat.c $(PULSE)
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
|
|
|
bt: src/bt.c $(PULSE)
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
|
|
|
carrier: src/carrier.c
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
|
|
|
zebrad: src/zebrad.c include/zebra.h
|
|
$(CC) $(CFLAGS) -o $@ src/zebrad.c $(LDFLAGS) -lm
|
|
|
|
blog:
|
|
python3 blog/build.py
|
|
|
|
serve: blog
|
|
cd web && python3 -m http.server 8765
|
|
|
|
clean:
|
|
rm -f tx rx chat bt carrier zebrad test/unit test/integration test/functional
|
|
rm -rf web/blog/001-volume-modem web/blog/002-sse-chatroom web/blog/index.html
|