Makefile 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. INC_PATH = inc
  2. SRC_PATH = src
  3. OBJ_PATH = obj
  4. BIN_PATH = bin
  5. TMP_PATH = tmp
  6. PRSONA_PATH = .
  7. PRSONA_INC_PATH = $(PRSONA_PATH)/$(INC_PATH)
  8. PRSONA_SRC_PATH = $(PRSONA_PATH)/$(SRC_PATH)
  9. PRSONA_OBJ_PATH = $(PRSONA_PATH)/$(OBJ_PATH)
  10. PRSONA_BIN_PATH = $(PRSONA_PATH)/$(BIN_PATH)
  11. PRSONA_TMP_PATH = $(PRSONA_PATH)/$(TMP_PATH)
  12. BGN_PATH = ../BGN2/bgn2
  13. BGN_INC_PATH = $(BGN_PATH)/$(INC_PATH)
  14. BGN_SRC_PATH = $(BGN_PATH)/$(SRC_PATH)
  15. BGN_OBJ_PATH = $(BGN_PATH)/$(OBJ_PATH)
  16. BGN_BIN_PATH = $(BGN_PATH)/$(BIN_PATH)
  17. 666_PATH = ../BGN2/dclxvi-20130329
  18. 666_INC_PATH = $(666_PATH)/$(INC_PATH)
  19. 666_SRC_PATH = $(666_PATH)/$(SRC_PATH)
  20. 666_OBJ_PATH = $(666_PATH)/$(OBJ_PATH)
  21. 666_BIN_PATH = $(666_PATH)/$(BIN_PATH)
  22. MG_PATH = ../civetweb
  23. MG_INC_PATH = $(MG_PATH)/include
  24. MG_OBJ_PATH = $(MG_PATH)/out/src
  25. CPP = g++
  26. CPPFLAGS = -std=c++14 -Wall -I$(PRSONA_INC_PATH) -I$(BGN_INC_PATH) -I$(666_INC_PATH) -I$(MG_INC_PATH) -O2
  27. CPPTESTFLAGS = -std=c++14 -Wall -I$(PRSONA_INC_PATH) -I$(BGN_INC_PATH) -I$(666_INC_PATH) -I$(MG_INC_PATH) -g
  28. LDFLAGS = -lgmp -lgmpxx -lssl -lcrypto
  29. NETWORK_LDFLAGS = -ldl -lpthread
  30. LDTESTFLAGS = -lgmp -lgmpxx -lssl -lcrypto -g
  31. CC = gcc
  32. CFLAGS = -std=c99 -O3 -fomit-frame-pointer -I$(666_INC_PATH) -I$(MG_INC_PATH)
  33. C_LDFLAGS = -lm
  34. all : localTest server client orchestrator
  35. localTest: $(PRSONA_BIN_PATH) $(PRSONA_OBJ_PATH) $(BGN_OBJ_PATH) $(666_OBJ_PATH) $(PRSONA_BIN_PATH)/localTest
  36. server: $(PRSONA_BIN_PATH) $(PRSONA_OBJ_PATH) $(BGN_OBJ_PATH) $(666_OBJ_PATH) $(PRSONA_TMP_PATH) $(PRSONA_BIN_PATH)/server
  37. client: $(PRSONA_BIN_PATH) $(PRSONA_OBJ_PATH) $(BGN_OBJ_PATH) $(666_OBJ_PATH) $(PRSONA_TMP_PATH) $(PRSONA_BIN_PATH)/client
  38. orchestrator: $(PRSONA_BIN_PATH) $(PRSONA_OBJ_PATH) $(BGN_OBJ_PATH) $(666_OBJ_PATH) $(PRSONA_TMP_PATH) $(PRSONA_BIN_PATH)/orchestrator
  39. $(PRSONA_TMP_PATH):
  40. mkdir -p $@
  41. $(PRSONA_BIN_PATH):
  42. mkdir -p $@
  43. $(PRSONA_OBJ_PATH):
  44. mkdir -p $@
  45. $(BGN_OBJ_PATH):
  46. mkdir -p $@
  47. $(666_OBJ_PATH):
  48. mkdir -p $@
  49. $(MG_OBJ_PATH):
  50. mkdir -p $@
  51. PRSONA_FULL_SRC = $(wildcard $(PRSONA_SRC_PATH)/*.cpp)
  52. PRSONA_FULL_NETWORK_SRC = $(wildcard $(PRSONA_SRC_PATH)/network*.cpp)
  53. PRSONA_SRC = $(filter-out $(PRSONA_FULL_NETWORK_SRC) $(wildcard $(PRSONA_SRC_PATH)/*Main.cpp), $(PRSONA_FULL_SRC))
  54. PRSONA_SHARED_NETWORK_OBJ = $(PRSONA_OBJ_PATH)/networking.o
  55. PRSONA_SERVER_NETWORK_OBJ = $(PRSONA_OBJ_PATH)/networkServer.o
  56. PRSONA_CLIENT_NETWORK_OBJ = $(PRSONA_OBJ_PATH)/networkClient.o
  57. PRSONA_ORCHESTRATOR_NETWORK_OBJ = $(PRSONA_OBJ_PATH)/networkOrchestrator.o
  58. PRSONA_NETWORK_OBJ = $(patsubst $(PRSONA_SRC_PATH)/%.cpp, $(PRSONA_OBJ_PATH)/%.o, $(PRSONA_NETWORK_SRC))
  59. PRSONA_OBJ = $(patsubst $(PRSONA_SRC_PATH)/%.cpp, $(PRSONA_OBJ_PATH)/%.o, $(PRSONA_SRC))
  60. $(PRSONA_OBJ_PATH)/%.o: $(PRSONA_SRC_PATH)/%.cpp
  61. $(CPP) $(CPPFLAGS) -DQHASM -c -o $@ $<
  62. BGN_FULL_SRC = $(wildcard $(BGN_SRC_PATH)/*.cpp)
  63. BGN_SRC = $(filter-out $(BGN_SRC_PATH)/main.cpp, $(BGN_FULL_SRC))
  64. BGN_OBJ = $(patsubst $(BGN_SRC_PATH)/%.cpp, $(BGN_OBJ_PATH)/%.o, $(BGN_SRC))
  65. $(BGN_OBJ_PATH)/%.o: $(BGN_SRC_PATH)/%.cpp
  66. $(CPP) $(CPPFLAGS) -DQHASM -c -o $@ $<
  67. 666_ALL_C_SRC = $(wildcard $(666_SRC_PATH)/*.c)
  68. 666_C_SRC = $(filter-out $(666_SRC_PATH)/bilintest.c $(666_SRC_PATH)/speedtest.c $(666_SRC_PATH)/test_curvepoint_multiscalar.c $(666_SRC_PATH)/test_twistpoint_multiscalar.c $(666_SRC_PATH)/twistpoint_fp2_multiscalar.c $(666_SRC_PATH)/curvepoint_fp_multiscalar.c, $(666_ALL_C_SRC))
  69. 666_C_OBJ = $(patsubst $(666_SRC_PATH)/%.c, $(666_OBJ_PATH)/%_c_with_as.o, $(666_C_SRC))
  70. $(666_OBJ_PATH)/%_c_with_as.o: $(666_SRC_PATH)/%.c $(666_INC_PATH)/%.h
  71. $(CC) $(CFLAGS) -DQHASM -c -o $@ $<
  72. 666_AS_SRC = $(wildcard $(666_SRC_PATH)/*.s)
  73. 666_AS_OBJ = $(patsubst $(666_SRC_PATH)/%.s, $(666_OBJ_PATH)/%_as.o, $(666_AS_SRC))
  74. $(666_OBJ_PATH)/%_as.o: $(666_SRC_PATH)/%.s
  75. $(CC) $(CFLAGS) -fPIC -c -o $@ $^
  76. $(BGN_OBJ_PATH)/bgn.a: $(666_AS_OBJ) $(666_C_OBJ) $(BGN_OBJ)
  77. rm -f $@
  78. ar cr $@ $^
  79. MG_OBJ += $(MG_OBJ_PATH)/civetweb.o
  80. MG_OBJ += $(MG_OBJ_PATH)/CivetServer.o
  81. $(MG_OBJ_PATH)/%.o:
  82. make -C ../civetweb WITH_WEBSOCKET=1 WITH_CPP=1 WITH_SERVER_STATS=1 lib
  83. $(PRSONA_BIN_PATH)/localTest: $(PRSONA_OBJ_PATH)/localMain.o $(PRSONA_OBJ) $(BGN_OBJ_PATH)/bgn.a
  84. $(CPP) $(CPPFLAGS) -no-pie -o $@ $^ $(LDFLAGS)
  85. $(PRSONA_BIN_PATH)/server: $(PRSONA_OBJ_PATH)/serverMain.o $(PRSONA_OBJ) $(PRSONA_SHARED_NETWORK_OBJ) $(PRSONA_SERVER_NETWORK_OBJ) $(MG_OBJ) $(BGN_OBJ_PATH)/bgn.a
  86. $(CPP) $(CPPFLAGS) -no-pie -o $@ $^ $(LDFLAGS) $(NETWORK_LDFLAGS)
  87. $(PRSONA_BIN_PATH)/client: $(PRSONA_OBJ_PATH)/clientMain.o $(PRSONA_OBJ) $(PRSONA_SHARED_NETWORK_OBJ) $(PRSONA_CLIENT_NETWORK_OBJ) $(MG_OBJ) $(BGN_OBJ_PATH)/bgn.a
  88. $(CPP) $(CPPFLAGS) -no-pie -o $@ $^ $(LDFLAGS) $(NETWORK_LDFLAGS)
  89. $(PRSONA_BIN_PATH)/orchestrator: $(PRSONA_OBJ_PATH)/orchestratorMain.o $(PRSONA_OBJ) $(PRSONA_SHARED_NETWORK_OBJ) $(PRSONA_ORCHESTRATOR_NETWORK_OBJ) $(MG_OBJ) $(BGN_OBJ_PATH)/bgn.a
  90. $(CPP) $(CPPFLAGS) -no-pie -o $@ $^ $(LDFLAGS) $(NETWORK_LDFLAGS)
  91. .PHONY: clean
  92. clean: prsona_clean bgn_clean 666_clean mg_clean
  93. pclean: prsona_clean
  94. seemly:
  95. -rm $(PRSONA_TMP_PATH)/*
  96. -pkill client
  97. -pkill server
  98. demolition:
  99. -scripts/bringDownTestServers.sh
  100. prsona_clean:
  101. -rm $(PRSONA_BIN_PATH)/*
  102. -rm $(PRSONA_OBJ_PATH)/*
  103. bgn_clean:
  104. -rm $(BGN_OBJ_PATH)/*
  105. 666_clean:
  106. -rm $(666_OBJ_PATH)/*
  107. mg_clean:
  108. make -C ../civetweb clean