From a6bf5ac81d2ebd68c47ebc3fc01df03b089a8996 Mon Sep 17 00:00:00 2001 From: Roman <22231294+Lutymane@users.noreply.github.com> Date: Fri, 30 Jun 2023 11:57:56 +0400 Subject: [PATCH] feat(makefile): add release script --- makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/makefile b/makefile index 1d7e213..ab284c0 100644 --- a/makefile +++ b/makefile @@ -1,10 +1,13 @@ -OPENSSL_PATH=/home/ceo/src/openssl - build: # source should go before libs, otherwise they are skipped # -L/usr/local/lib64/ # -std=c++2a for string.endsWith - g++ main.cpp -std=c++2a -pthread -L/usr/local/lib64/ -lcrypto -o mars + g++ -std=c++2a main.cpp -pthread -L/usr/local/lib64/ -lcrypto -o mars + +release: +# https://stackoverflow.com/a/21250906/14776286 +# statically link libs + remove unused symbols + g++ -std=c++2a -O3 -fdata-sections -ffunction-sections main.cpp -pthread -static -L/usr/local/lib64/ -lcrypto -lz -ldl -o mars -Wl,--gc-sections -Wl,--strip-all test: g++ test.cpp -pthread -L/usr/local/lib64/ -lcrypto -o test-suite && ./test-suite \ No newline at end of file