aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-12-06 09:45:54 -0500
committerDeterminant <[email protected]>2019-12-06 09:45:54 -0500
commitb6d1796be78b1156d835f8a81efbf8cc24750520 (patch)
tree273144a7b7a181a39651d1953a895c58c446cd84 /Makefile
parentec20efb7676c597c26edc63ae0ac47d3ec8b478c (diff)
improve build scripts
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile35
1 files changed, 11 insertions, 24 deletions
diff --git a/Makefile b/Makefile
index 89b6b7e..5cb488f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,35 +1,22 @@
-# 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/libsalticidae.a: build
+ scripts/build.sh
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
+build/test_msgnet: build/libsalticidae.a test_msgnet/main.go
+ source scripts/env.sh && go build -o $@ github.com/Determinant/salticidae-go/test_msgnet
+build/test_msgnet_tls: build/libsalticidae.a test_msgnet_tls/main.go
+ source scripts/env.sh && go build -o $@ github.com/Determinant/salticidae-go/test_msgnet_tls
+build/test_p2p_stress: build/libsalticidae.a test_p2p_stress/main.go
+ source scripts/env.sh && go build -o $@ github.com/Determinant/salticidae-go/test_p2p_stress
+build/bench_network: build/libsalticidae.a bench_network/main.go
+ source scripts/env.sh && go build -o $@ github.com/Determinant/salticidae-go/bench_network
clean:
rm -rf build/
- cd salticidae/; make clean
- rm salticidae/CMakeCache.txt
+ scripts/clean.sh