Skip to content

Commit

Permalink
Уменьшение размера бинарников
Browse files Browse the repository at this point in the history
  • Loading branch information
etar125 committed Aug 19, 2024
1 parent f08ec03 commit 6fbf722
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
FLAGS=-O2 -ffunction-sections -Wl,--gc-sections,--strip-all -fno-asynchronous-unwind-tables

default: $(shell mkdir -p bin) library test

library: tinyss.cpp tinyss.hpp token.hpp
g++ -c tinyss.cpp -o bin/tinyss.o
g++ -c tinyss.cpp -o bin/tinyss.o $(FLAGS)
ar r bin/libtinyss.a bin/tinyss.o
rm -f bin/tinyss.o
cp tinyss.hpp bin/tinyss.hpp
cp token.hpp bin/token.hpp

test: bin/libtinyss.a test.cpp
g++ test.cpp -o bin/test -Lbin -ltinyss
g++ test.cpp -o bin/test -Lbin -ltinyss $(FLAGS)

clean:
rm -f $(wildcard bin/*)
rm -f $(wildcard bin/*)

0 comments on commit 6fbf722

Please sign in to comment.