Makefile 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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 -lpthread
  29. NETWORK_LDFLAGS = -ldl
  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 queue
  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. queue: $(PRSONA_BIN_PATH) $(PRSONA_BIN_PATH)/queue
  40. $(PRSONA_TMP_PATH):
  41. mkdir -p $@
  42. $(PRSONA_BIN_PATH):
  43. mkdir -p $@
  44. $(PRSONA_OBJ_PATH):
  45. mkdir -p $@
  46. $(BGN_OBJ_PATH):
  47. mkdir -p $@
  48. $(666_OBJ_PATH):
  49. mkdir -p $@
  50. $(MG_OBJ_PATH):
  51. mkdir -p $@
  52. PRSONA_FULL_SRC = $(wildcard $(PRSONA_SRC_PATH)/*.cpp)
  53. PRSONA_FULL_NETWORK_SRC = $(wildcard $(PRSONA_SRC_PATH)/network*.cpp)
  54. PRSONA_SRC = $(filter-out $(PRSONA_FULL_NETWORK_SRC) $(wildcard $(PRSONA_SRC_PATH)/*Main.cpp), $(PRSONA_FULL_SRC))
  55. PRSONA_SHARED_NETWORK_OBJ = $(PRSONA_OBJ_PATH)/networking.o
  56. PRSONA_SERVER_NETWORK_OBJ = $(PRSONA_OBJ_PATH)/networkServer.o
  57. PRSONA_CLIENT_NETWORK_OBJ = $(PRSONA_OBJ_PATH)/networkClient.o
  58. PRSONA_ORCHESTRATOR_NETWORK_OBJ = $(PRSONA_OBJ_PATH)/networkOrchestrator.o
  59. PRSONA_NETWORK_OBJ = $(patsubst $(PRSONA_SRC_PATH)/%.cpp, $(PRSONA_OBJ_PATH)/%.o, $(PRSONA_NETWORK_SRC))
  60. PRSONA_OBJ = $(patsubst $(PRSONA_SRC_PATH)/%.cpp, $(PRSONA_OBJ_PATH)/%.o, $(PRSONA_SRC))
  61. $(PRSONA_OBJ_PATH)/%.o: $(PRSONA_SRC_PATH)/%.cpp
  62. $(CPP) $(CPPFLAGS) -DQHASM -c -o $@ $<
  63. BGN_FULL_SRC = $(wildcard $(BGN_SRC_PATH)/*.cpp)
  64. BGN_SRC = $(filter-out $(BGN_SRC_PATH)/main.cpp, $(BGN_FULL_SRC))
  65. BGN_OBJ = $(patsubst $(BGN_SRC_PATH)/%.cpp, $(BGN_OBJ_PATH)/%.o, $(BGN_SRC))
  66. $(BGN_OBJ_PATH)/%.o: $(BGN_SRC_PATH)/%.cpp
  67. $(CPP) $(CPPFLAGS) -DQHASM -c -o $@ $<
  68. 666_ALL_C_SRC = $(wildcard $(666_SRC_PATH)/*.c)
  69. 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))
  70. 666_C_OBJ = $(patsubst $(666_SRC_PATH)/%.c, $(666_OBJ_PATH)/%_c_with_as.o, $(666_C_SRC))
  71. $(666_OBJ_PATH)/%_c_with_as.o: $(666_SRC_PATH)/%.c $(666_INC_PATH)/%.h
  72. $(CC) $(CFLAGS) -DQHASM -c -o $@ $<
  73. 666_AS_SRC = $(wildcard $(666_SRC_PATH)/*.s)
  74. 666_AS_OBJ = $(patsubst $(666_SRC_PATH)/%.s, $(666_OBJ_PATH)/%_as.o, $(666_AS_SRC))
  75. $(666_OBJ_PATH)/%_as.o: $(666_SRC_PATH)/%.s
  76. $(CC) $(CFLAGS) -fPIC -c -o $@ $^
  77. $(BGN_OBJ_PATH)/bgn.a: $(666_AS_OBJ) $(666_C_OBJ) $(BGN_OBJ)
  78. rm -f $@
  79. ar cr $@ $^
  80. MG_OBJ += $(MG_OBJ_PATH)/civetweb.o
  81. MG_OBJ += $(MG_OBJ_PATH)/CivetServer.o
  82. $(MG_OBJ_PATH)/%.o:
  83. make -C ../civetweb WITH_WEBSOCKET=1 WITH_CPP=1 WITH_SERVER_STATS=1 lib
  84. $(PRSONA_BIN_PATH)/localTest: $(PRSONA_OBJ_PATH)/localMain.o $(PRSONA_OBJ) $(BGN_OBJ_PATH)/bgn.a
  85. $(CPP) $(CPPFLAGS) -no-pie -o $@ $^ $(LDFLAGS)
  86. $(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
  87. $(CPP) $(CPPFLAGS) -no-pie -o $@ $^ $(LDFLAGS) $(NETWORK_LDFLAGS)
  88. $(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
  89. $(CPP) $(CPPFLAGS) -no-pie -o $@ $^ $(LDFLAGS) $(NETWORK_LDFLAGS)
  90. $(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
  91. $(CPP) $(CPPFLAGS) -no-pie -o $@ $^ $(LDFLAGS) $(NETWORK_LDFLAGS)
  92. $(PRSONA_BIN_PATH)/queue: $(PRSONA_SRC_PATH)/experimentQueueMain.cpp
  93. $(CPP) $(CPPFLAGS) -o $@ $^
  94. .PHONY: clean
  95. clean: prsona_clean bgn_clean 666_clean mg_clean
  96. pclean: prsona_clean
  97. seemly:
  98. -rm $(PRSONA_TMP_PATH)/*
  99. -pkill client
  100. -pkill server
  101. demolition:
  102. -scripts/bringDownTestServers.sh
  103. prsona_clean:
  104. -rm $(PRSONA_BIN_PATH)/*
  105. -rm $(PRSONA_OBJ_PATH)/*
  106. bgn_clean:
  107. -rm $(BGN_OBJ_PATH)/*
  108. 666_clean:
  109. -rm $(666_OBJ_PATH)/*
  110. mg_clean:
  111. make -C ../civetweb clean