Makefile 1.3 KB

123456789101112131415161718192021222324252627282930
  1. #CXX = clang++
  2. CXXFLAGS = -ggdb -O0 -std=c++11 -DGTEST_USE_OWN_TR1_TUPLE -I.. -I. -Wall -Wextra -Wtype-limits -Wconversion
  3. OPENSSL_DIR = /usr/local/opt/openssl
  4. OPENSSL_SUPPORT = -DCPPHTTPLIB_OPENSSL_SUPPORT -I$(OPENSSL_DIR)/include -L$(OPENSSL_DIR)/lib -lssl -lcrypto
  5. ZLIB_SUPPORT = -DCPPHTTPLIB_ZLIB_SUPPORT -lz
  6. all : test
  7. ./test
  8. proxy : test_proxy
  9. ./test_proxy
  10. test : test.cc ../httplib.h Makefile cert.pem
  11. $(CXX) -o test $(CXXFLAGS) test.cc gtest/gtest-all.cc gtest/gtest_main.cc $(OPENSSL_SUPPORT) $(ZLIB_SUPPORT) -pthread
  12. test_proxy : test_proxy.cc ../httplib.h Makefile cert.pem
  13. $(CXX) -o test_proxy $(CXXFLAGS) test_proxy.cc gtest/gtest-all.cc gtest/gtest_main.cc $(OPENSSL_SUPPORT) $(ZLIB_SUPPORT) -pthread
  14. cert.pem:
  15. openssl genrsa 2048 > key.pem
  16. openssl req -new -batch -config test.conf -key key.pem | openssl x509 -days 3650 -req -signkey key.pem > cert.pem
  17. openssl genrsa 2048 > rootCA.key.pem
  18. openssl req -x509 -new -batch -config test.rootCA.conf -key rootCA.key.pem -days 1024 > rootCA.cert.pem
  19. openssl genrsa 2048 > client.key.pem
  20. openssl req -new -batch -config test.conf -key client.key.pem | openssl x509 -days 370 -req -CA rootCA.cert.pem -CAkey rootCA.key.pem -CAcreateserial > client.cert.pem
  21. #c_rehash .
  22. clean:
  23. rm -f test test_proxy pem *.0 *.1 *.srl