2021-06-21 20:57:28 +04:00
|
|
|
#CXX = clang++
|
2022-06-15 21:54:21 +04:00
|
|
|
CXXFLAGS = -O2 -std=c++11 -I.. -Wall -Wextra -pthread
|
|
|
|
|
|
|
|
PREFIX = /usr/local
|
|
|
|
#PREFIX = $(shell brew --prefix)
|
2021-06-21 20:57:28 +04:00
|
|
|
|
2022-06-15 21:54:21 +04:00
|
|
|
OPENSSL_DIR = $(PREFIX)/opt/openssl@1.1
|
|
|
|
#OPENSSL_DIR = $(PREFIX)/opt/openssl@3
|
2021-06-21 20:57:28 +04:00
|
|
|
OPENSSL_SUPPORT = -DCPPHTTPLIB_OPENSSL_SUPPORT -I$(OPENSSL_DIR)/include -L$(OPENSSL_DIR)/lib -lssl -lcrypto
|
|
|
|
|
|
|
|
ZLIB_SUPPORT = -DCPPHTTPLIB_ZLIB_SUPPORT -lz
|
|
|
|
|
2022-06-15 21:54:21 +04:00
|
|
|
BROTLI_DIR = $(PREFIX)/opt/brotli
|
|
|
|
BROTLI_SUPPORT = -DCPPHTTPLIB_BROTLI_SUPPORT -I$(BROTLI_DIR)/include -L$(BROTLI_DIR)/lib -lbrotlicommon -lbrotlienc -lbrotlidec
|
2021-06-21 20:57:28 +04:00
|
|
|
|
|
|
|
all: server client hello simplecli simplesvr upload redirect ssesvr ssecli benchmark
|
|
|
|
|
|
|
|
server : server.cc ../httplib.h Makefile
|
|
|
|
$(CXX) -o server $(CXXFLAGS) server.cc $(OPENSSL_SUPPORT) $(ZLIB_SUPPORT) $(BROTLI_SUPPORT)
|
|
|
|
|
|
|
|
client : client.cc ../httplib.h Makefile
|
|
|
|
$(CXX) -o client $(CXXFLAGS) client.cc $(OPENSSL_SUPPORT) $(ZLIB_SUPPORT) $(BROTLI_SUPPORT)
|
|
|
|
|
|
|
|
hello : hello.cc ../httplib.h Makefile
|
|
|
|
$(CXX) -o hello $(CXXFLAGS) hello.cc $(OPENSSL_SUPPORT) $(ZLIB_SUPPORT) $(BROTLI_SUPPORT)
|
|
|
|
|
|
|
|
simplecli : simplecli.cc ../httplib.h Makefile
|
|
|
|
$(CXX) -o simplecli $(CXXFLAGS) simplecli.cc $(OPENSSL_SUPPORT) $(ZLIB_SUPPORT) $(BROTLI_SUPPORT)
|
|
|
|
|
|
|
|
simplesvr : simplesvr.cc ../httplib.h Makefile
|
|
|
|
$(CXX) -o simplesvr $(CXXFLAGS) simplesvr.cc $(OPENSSL_SUPPORT) $(ZLIB_SUPPORT) $(BROTLI_SUPPORT)
|
|
|
|
|
|
|
|
upload : upload.cc ../httplib.h Makefile
|
|
|
|
$(CXX) -o upload $(CXXFLAGS) upload.cc $(OPENSSL_SUPPORT) $(ZLIB_SUPPORT) $(BROTLI_SUPPORT)
|
|
|
|
|
|
|
|
redirect : redirect.cc ../httplib.h Makefile
|
|
|
|
$(CXX) -o redirect $(CXXFLAGS) redirect.cc $(OPENSSL_SUPPORT) $(ZLIB_SUPPORT) $(BROTLI_SUPPORT)
|
|
|
|
|
|
|
|
ssesvr : ssesvr.cc ../httplib.h Makefile
|
|
|
|
$(CXX) -o ssesvr $(CXXFLAGS) ssesvr.cc $(OPENSSL_SUPPORT) $(ZLIB_SUPPORT) $(BROTLI_SUPPORT)
|
|
|
|
|
|
|
|
ssecli : ssecli.cc ../httplib.h Makefile
|
|
|
|
$(CXX) -o ssecli $(CXXFLAGS) ssecli.cc $(OPENSSL_SUPPORT) $(ZLIB_SUPPORT) $(BROTLI_SUPPORT)
|
|
|
|
|
|
|
|
benchmark : benchmark.cc ../httplib.h Makefile
|
|
|
|
$(CXX) -o benchmark $(CXXFLAGS) benchmark.cc $(OPENSSL_SUPPORT) $(ZLIB_SUPPORT) $(BROTLI_SUPPORT)
|
|
|
|
|
|
|
|
pem:
|
|
|
|
openssl genrsa 2048 > key.pem
|
|
|
|
openssl req -new -key key.pem | openssl x509 -days 3650 -req -signkey key.pem > cert.pem
|
|
|
|
|
|
|
|
clean:
|
2022-06-15 21:54:21 +04:00
|
|
|
rm server client hello simplecli simplesvr upload redirect ssesvr ssecli benchmark *.pem
|