-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
32 lines (24 loc) · 824 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
MOLC := moleculec
MOLC_VERSION := 0.7.3
MOLC_GO := moleculec-go
MOLC_GO_VERSION := 0.1.9
MOL_FILES := \
mol/protocol_select.mol \
secio/mol/handshake.mol \
protocols/identify/mol/protocol.mol \
protocols/ping/mol/protocol.mol \
protocols/discovery/mol/protocol.mol \
MOL_GO_FILES := $(patsubst %.mol,%_mol.go,${MOL_FILES})
test:
go test -count=1 .
go test -count=1 ./tests
go test -count=1 ./secio
check-moleculec-version:
test "$$(${MOLC} --version | awk '{ print $$2 }' | tr -d ' ')" = ${MOLC_VERSION}
test "$$(${MOLC_GO} --version | awk '{ print $$4 }' | tr -d ' ')" = ${MOLC_GO_VERSION}
%_mol.go: %.mol check-moleculec-version
${MOLC} --language go --schema-file $< | gofmt > $@
gen-mol: $(MOL_GO_FILES)
clean-mol:
rm -f $(MOL_GO_FILES)
.PHONY: test check-moleculec-version gen-mol clean-mol