summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 18 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 64facb5..633f8e4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
CXX = g++
+GIT = git
CXXFLAGS = -Wall -Wextra
SERVER_HDRS = socks5.hpp
SERVER_SRCS = socks5.cpp main.cpp
@@ -11,15 +12,28 @@ CXXFLAGS += -fsanitize=thread -fsanitize=undefined
endif
endif
ifneq ($(DEBUG),)
-CXXFLAGS += -g #-DBOOST_ASIO_ENABLE_HANDLER_TRACKING=1
+CXXFLAGS += -g3 #-DBOOST_ASIO_ENABLE_HANDLER_TRACKING=1
+else
+CXXFLAGS += -O3 -fomit-frame-pointer -flto
+endif
+ifneq ($(HANDLER_TRACKING),)
+CXXFLAGS += -DBOOST_ASIO_ENABLE_HANDLER_TRACKING=1
endif
-all: server
+all: git server
+
+git: boost-asio-fastbuffer/fastbuffer.hpp
-server: $(SERVER_HDRS) $(SERVER_SRCS)
+boost-asio-fastbuffer/fastbuffer.hpp:
+ $(GIT) submodule update --init
+
+server: boost-asio-fastbuffer/fastbuffer.hpp $(SERVER_HDRS) $(SERVER_SRCS)
$(CXX) $(CXXFLAGS) $(SERVER_SRCS) -o $@
clean:
rm -f server
-.PHONY: clean
+distclean: clean
+ $(GIT) submodule deinit --all --force
+
+.PHONY: all git clean distclean