aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 89b6b7e10f6f666144cb366285d6e669da0b1298 (plain) (blame)
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
33
34
35
# NOTE: this Makefile only serves the purpose as an example (works on my
# Linux). Your Go project uses salticidae-go should setup CGO environment
# variables properly to have a successful build.
#
# TODO: improve this Makefile

.PHONY: all clean

all: build/test_msgnet build/test_p2p_stress build/test_msgnet_tls build/bench_network


salticidae/libsalticidae.so:
	cd salticidae/; cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED=ON  -DSALTICIDAE_DEBUG_LOG=OFF -DSALTICIDAE_CBINDINGS=ON -DBUILD_TEST=OFF ./
	make -C salticidae/ -j4

build:
	mkdir -p build

build/test_msgnet: salticidae/libsalticidae.so test_msgnet/main.go
	make -C salticidae/
	go build -o $@ github.com/Determinant/salticidae-go/test_msgnet
build/test_msgnet_tls: salticidae/libsalticidae.so test_msgnet_tls/main.go
	make -C salticidae/
	go build -o $@ github.com/Determinant/salticidae-go/test_msgnet_tls
build/test_p2p_stress: salticidae/libsalticidae.so test_p2p_stress/main.go
	make -C salticidae/
	go build -o $@ github.com/Determinant/salticidae-go/test_p2p_stress
build/bench_network: salticidae/libsalticidae.so bench_network/main.go
	make -C salticidae/
	go build -o $@ github.com/Determinant/salticidae-go/bench_network

clean:
	rm -rf build/
	cd salticidae/; make clean
	rm salticidae/CMakeCache.txt