Add makefile

This commit is contained in:
Joseph Henry
2023-07-24 12:58:44 -07:00
parent 8079111fa8
commit 5dccf33b08
4 changed files with 36 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
[submodule "ext/libzt"]
path = ext/libzt
url = https://github.com/zerotier/libzt.git
[submodule "ext/ZeroTierOne"]
path = ext/ZeroTierOne
url = https://github.com/zerotier/ZeroTierOne.git
+1
Submodule ext/ZeroTierOne added at 12e64aa191
Submodule
+1
Submodule ext/libzt added at 8d21a265cc
+28
View File
@@ -0,0 +1,28 @@
CXX=$(shell which clang++ g++ c++ 2>/dev/null | head -n 1)
INCLUDES?=-Iext/libzt/ext/ZeroTierOne/osdep
release:
git submodule update --init
git -C ext/libzt submodule update --init
-cp libzt.patch ext/libzt
-git -C ext/libzt apply --reject libzt.patch
cd ext/libzt && ./build.sh host "release"
clang++ -Wno-deprecated pylon.c -o pylon ext/libzt/dist/*-host-release/lib/libzt.a -Iext/libzt/include
debug:
git submodule update --init
git -C ext/libzt submodule update --init
-cp libzt.patch ext/libzt
-git -C ext/libzt apply --reject libzt.patch
cd ext/libzt && ./build.sh host "debug"
clang++ -DPYLON_DEBUG=1 -g -Wno-deprecated pylon.c -o pylon-debug ext/libzt/dist/*-host-debug/lib/libzt.a -Iext/libzt/include -fsanitize=address -DASAN_OPTIONS=symbolize=1
relay:
$(CXX) -O3 -fno-rtti $(INCLUDES) -std=c++11 -frtti -o tcp-proxy tcp-proxy.cpp
clean:
rm -rf pylon pylon-*
rm -f *.o tcp-proxy *.dSYM
fmt:
clang-format -i pylon.c -style file