makefile 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # OS =
  2. # linux_arm64
  3. # linux_x64
  4. # win32_mingw64
  5. CXX = g++
  6. CXX_FLAGS = -std=c++17 -w
  7. INC = -I./include/
  8. LD_FLAGS =
  9. ifeq ($(OS), win32_mingw64)
  10. LD_LIBS = -L./lib/win32_mingw64/ -lbinom -ltcp -lstdc++fs -lpthread -lssl -lcrypto -lws2_32
  11. else
  12. LD_LIBS = -L./lib/$(OS)/ -lbinom -ltcp -lstdc++fs -lpthread -lssl -lcrypto
  13. endif
  14. ifeq ($(DBG), true)
  15. CXX_FLAGS += -ggdb
  16. endif
  17. SRV_SRC = source/server/application.cpp source/security.cpp source/server/layered_action_routing.cpp source/server/actions.cpp
  18. SRV_OBJ = application.o security.o layered_action_routing.o actions.o
  19. server: $(SRV_OBJ) build_folder
  20. $(CXX) -o librehubd $(SRV_OBJ) $(LD_LIBS) $(LD_FLAGS)
  21. mv librehubd build/
  22. security.o: source/security.cpp
  23. $(CXX) -c source/security.cpp $(INC) $(CXX_FLAGS)
  24. application.o: source/server/application.cpp
  25. $(CXX) -c source/server/application.cpp $(INC) $(CXX_FLAGS)
  26. layered_action_routing.o: source/server/layered_action_routing.cpp
  27. $(CXX) -c source/server/layered_action_routing.cpp $(INC) $(CXX_FLAGS)
  28. actions.o: source/server/actions.cpp
  29. $(CXX) -c source/server/actions.cpp $(INC) $(CXX_FLAGS)
  30. libtcp_update:
  31. make -C TcpServer libtcp.a
  32. mv TcpServer/libtcp.a lib/$(OS)/
  33. make -C TcpServer clean
  34. libbinom_update:
  35. make -C BinOM libbinom.a
  36. mv BinOM/libbinom.a lib/$(OS)/
  37. make -C BinOM clean
  38. tcp_inc_update:
  39. rm -rf include/tcp/*
  40. cp TcpServer/tcp/include/* include/tcp/
  41. binom_inc_update:
  42. rm -rf include/binom/*
  43. cp BinOM/libbinom/include/* include/binom/ -r
  44. build_folder:
  45. mkdir build -p
  46. inc_update: tcp_inc_update binom_inc_update
  47. libs_update: libtcp_update libbinom_update
  48. tcp_update: libtcp_update tcp_inc_update
  49. binom_update: libbinom_update binom_inc_update
  50. clean:
  51. rm -rf ./*.o ./librehubd ./build