aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 15 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index dfdac40..43b5417 100644
--- a/Makefile
+++ b/Makefile
@@ -85,6 +85,12 @@ $(BUILD)/test_smtp: $(BUILD)/tests/smtp_check.o $(BUILD)/src/smtp.o \
$(BUILD)/vendor/sha256.o
$(CC) $(CFLAGS) -o $@ $^ -lm -lssl -lcrypto
+$(BUILD)/gen_protocol: $(BUILD)/scripts/gen_protocol.o $(CORE_OBJ) $(VENDOR_OBJ)
+ $(CC) $(CFLAGS) -o $@ $^ -lm $(SSL_LIBS)
+
+gen-protocol: $(BUILD)/gen_protocol
+ $(BUILD)/gen_protocol --write docs/PROTOCOL.md
+
test: check $(BUILD)/test_core $(BUILD)/test_tui $(BUILD)/test_pdf \
$(BUILD)/test_invoice $(BUILD)/test_smtp
$(BUILD)/test_core
@@ -96,7 +102,8 @@ test: check $(BUILD)/test_core $(BUILD)/test_tui $(BUILD)/test_pdf \
test-core: $(BUILD)/test_core
$(BUILD)/test_core
-check:
+check: $(BUILD)/gen_protocol
+ $(BUILD)/gen_protocol --check docs/PROTOCOL.md
sh scripts/check-consistency.sh
test-pty: all
@@ -127,6 +134,10 @@ $(BUILD)/clients/%.o: clients/%.c
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(DEPFLAGS) $(WARN) $(CPPFLAGS) $(DEFS) -c $< -o $@
+$(BUILD)/scripts/%.o: scripts/%.c
+ @mkdir -p $(dir $@)
+ $(CC) $(CFLAGS) $(DEPFLAGS) $(WARN) $(CPPFLAGS) $(DEFS) -c $< -o $@
+
$(BUILD)/tests/%.o: tests/%.c
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(DEPFLAGS) $(WARN) $(CPPFLAGS) $(DEFS) -c $< -o $@
@@ -135,7 +146,8 @@ $(BUILD)/tests/%.o: tests/%.c
$(BUILD)/clients/bokfctl.d $(BUILD)/clients/bokftui.d \
$(BUILD)/clients/ui.d $(TUI_SCREEN_DEP) \
$(BUILD)/clients/tui.d $(BUILD)/clients/client.d \
- $(BUILD)/tests/test_core.d $(BUILD)/tests/test_tui.d
+ $(BUILD)/tests/test_core.d $(BUILD)/tests/test_tui.d \
+ $(BUILD)/scripts/gen_protocol.d
install: all
install -d $(DESTDIR)/usr/local/bin $(DESTDIR)/usr/local/share/bokf
@@ -146,5 +158,5 @@ install: all
clean:
rm -rf $(BUILD) build-asan build-ubsan
-.PHONY: all backend test test-core test-pty check test-asan test-ubsan gate \
+.PHONY: all backend test test-core test-pty check gen-protocol test-asan test-ubsan gate \
install clean