2023-02-14 19:51:14 +01:00
|
|
|
SYS := $(shell $(CXX) -dumpmachine)
|
|
|
|
|
2024-09-02 16:18:08 +02:00
|
|
|
CXXFLAGS += -Wall -Wno-unused-parameter -Wextra -pedantic -O0 -g -std=c++17 -D_GLIBCXX_USE_NANOSLEEP=1 -DOPENSSL_SUPPRESS_DEPRECATED -pthread -Wl,--unresolved-symbols=ignore-in-object-files
|
2021-09-05 00:55:51 +02:00
|
|
|
INCFLAGS += -I../libi2pd
|
2016-04-27 02:00:00 +02:00
|
|
|
|
2023-01-30 02:17:49 +01:00
|
|
|
LIBI2PD = ../libi2pd.a
|
|
|
|
|
|
|
|
TESTS = \
|
|
|
|
test-http-merge_chunked test-http-req test-http-res test-http-url test-http-url_decode \
|
2024-11-01 22:53:27 +01:00
|
|
|
test-gost test-gost-sig test-base-64 test-aeadchacha20poly1305 test-blinding \
|
2024-12-08 17:08:17 +01:00
|
|
|
test-elligator test-eddsa test-aes
|
2023-01-30 02:17:49 +01:00
|
|
|
|
2023-02-14 19:51:14 +01:00
|
|
|
ifneq (, $(findstring mingw, $(SYS))$(findstring windows-gnu, $(SYS))$(findstring cygwin, $(SYS)))
|
|
|
|
CXXFLAGS += -DWIN32_LEAN_AND_MEAN
|
|
|
|
LDFLAGS += -mwindows -static
|
|
|
|
BOOST_SUFFIX = -mt
|
|
|
|
NEEDED_LDLIBS = -lwsock32 -lws2_32 -lgdi32 -liphlpapi -lole32
|
|
|
|
endif
|
|
|
|
|
2023-01-30 02:17:49 +01:00
|
|
|
LDLIBS = \
|
2024-09-02 16:18:08 +02:00
|
|
|
-lboost_system$(BOOST_SUFFIX) \
|
2023-02-14 19:51:14 +01:00
|
|
|
-lboost_program_options$(BOOST_SUFFIX) \
|
2023-01-30 02:17:49 +01:00
|
|
|
-lssl \
|
2023-02-14 19:51:14 +01:00
|
|
|
-lcrypto \
|
|
|
|
-lz \
|
|
|
|
$(NEEDED_LDLIBS) \
|
2023-01-30 02:17:49 +01:00
|
|
|
-lpthread
|
2016-04-27 02:00:00 +02:00
|
|
|
|
2023-02-14 19:51:14 +01:00
|
|
|
|
2016-04-27 02:00:00 +02:00
|
|
|
all: $(TESTS) run
|
|
|
|
|
2023-01-30 02:17:49 +01:00
|
|
|
$(LIBI2PD):
|
|
|
|
@echo "Building libi2pd.a ..." && cd .. && $(MAKE) libi2pd.a
|
|
|
|
|
|
|
|
test-http-%: test-http-%.cpp $(LIBI2PD)
|
2023-02-14 19:51:14 +01:00
|
|
|
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
2016-06-28 02:00:00 +02:00
|
|
|
|
2023-01-30 02:17:49 +01:00
|
|
|
test-base-%: test-base-%.cpp $(LIBI2PD)
|
2023-02-14 19:51:14 +01:00
|
|
|
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
2016-04-27 02:00:00 +02:00
|
|
|
|
2023-01-30 02:17:49 +01:00
|
|
|
test-gost: test-gost.cpp $(LIBI2PD)
|
2023-02-14 19:51:14 +01:00
|
|
|
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
2017-03-21 14:43:36 +01:00
|
|
|
|
2023-01-30 02:17:49 +01:00
|
|
|
test-gost-sig: test-gost-sig.cpp $(LIBI2PD)
|
2023-02-14 19:51:14 +01:00
|
|
|
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
2018-06-13 00:29:06 +02:00
|
|
|
|
2023-01-30 02:17:49 +01:00
|
|
|
test-aeadchacha20poly1305: test-aeadchacha20poly1305.cpp $(LIBI2PD)
|
2023-02-14 19:51:14 +01:00
|
|
|
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
2018-06-13 18:25:32 +02:00
|
|
|
|
2023-01-30 02:17:49 +01:00
|
|
|
test-blinding: test-blinding.cpp $(LIBI2PD)
|
2023-02-14 19:51:14 +01:00
|
|
|
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
2019-05-31 17:57:16 +02:00
|
|
|
|
2023-01-30 02:17:49 +01:00
|
|
|
test-elligator: test-elligator.cpp $(LIBI2PD)
|
2023-02-14 19:51:14 +01:00
|
|
|
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
2019-12-10 19:20:23 +01:00
|
|
|
|
2023-12-18 15:32:12 +01:00
|
|
|
test-eddsa: test-eddsa.cpp $(LIBI2PD)
|
|
|
|
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
|
|
|
|
2024-12-08 17:08:17 +01:00
|
|
|
test-aes: test-aes.cpp $(LIBI2PD)
|
|
|
|
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
|
|
|
|
2016-04-27 02:00:00 +02:00
|
|
|
run: $(TESTS)
|
2023-01-30 02:17:49 +01:00
|
|
|
@for TEST in $(TESTS); do echo Running $$TEST; ./$$TEST ; done
|
2016-04-27 02:00:00 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(TESTS)
|