Makefile 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. CXX = g++
  2. RM = rm -f
  3. CXX_FLAGS = -Wall -O2 -std=c++11 -fpic
  4. LD = ${CXX} -v
  5. LD_FLAGS = -Wall -shared -Wl,--no-undefined
  6. OBJECTS := systemMain.o MainLogic.o LAInitiator/LA.o LAInitiator/Tramsforms.o ProtobufLAMessages.pb.o PostLA/PostLAMessaging.o PostLA/PostLAMessages.pb.o ProtobufMessageRW.o crypto.o
  7. SGX_SDK := /opt/intel/sgxsdk
  8. SGX_COMMON_CFLAGS := -m64
  9. SGX_LIBRARY_PATH := $(SGX_SDK)/lib64
  10. Trts_Library_Name := sgx_trts
  11. Service_Library_Name := sgx_tservice
  12. Crypto_Library_Name := sgx_tcrypto
  13. SgxC_Library_Name := sgx_tstdc
  14. SGX_INCLUDE_PATHS := -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx
  15. Uae_Library_Name := sgx_uae_service
  16. all: localattestation_decryption.so #${OBJECTS}
  17. clean:
  18. ${RM} *.obj *~* ${OBJECTS} localattestation_decryption.so
  19. Protobuf%.o: Protobuf%.cpp
  20. ${CXX} -I./include ${CXX_FLAGS} -c $^ -o $@
  21. PostLAMessages.pb.o: PostLAMessages.pb.cpp
  22. ${CXX} -I./include ${CXX_FLAGS} -c $^ -o $@
  23. system%.o: system%.cpp
  24. g++ -I./include ${CXX_FLAGS} -c $^ -o $@
  25. MainLogic.o: MainLogic.cpp
  26. g++ -I./include ${CXX_FLAGS} -c $^ -o $@
  27. PostLA/%.o: PostLA/%.cpp
  28. g++ -I./include -I$(SGX_SDK)/include ${CXX_FLAGS} -c $^ -o $@
  29. LAInitiator/%.o: LAInitiator/%.cpp
  30. g++ -I./include -I$(SGX_SDK)/include ${CXX_FLAGS} -c $^ -o $@
  31. ProtobufMessageRW.o: ProtobufMessageRW.cpp
  32. g++ -I./include ${CXX_FLAGS} -c $^ -o $@
  33. crypto.o: crypto.cpp
  34. g++ ${CXX_FLAGS} -c $^ -o $@
  35. localattestation_decryption.so: systemMain.o MainLogic.o LAInitiator/LA.o LAInitiator/Tramsforms.o ProtobufLAMessages.pb.o PostLA/PostLAMessaging.o PostLA/PostLAMessages.pb.o ProtobufMessageRW.o crypto.o
  36. ${CXX} ${LD_FLAGS} -Wl,--verbose systemMain.o MainLogic.o LAInitiator/LA.o LAInitiator/Tramsforms.o ProtobufLAMessages.pb.o PostLA/PostLAMessaging.o PostLA/PostLAMessages.pb.o ProtobufMessageRW.o crypto.o -lphpcpp -lcrypto -lssl -L$(SGX_LIBRARY_PATH) -l$(Service_Library_Name) -l$(Crypto_Library_Name) -l$(Trts_Library_Name) -l$(SgxC_Library_Name) -lprotobuf -Wl,-Bsymbolic -Wl,-pie,-eenclave_entry -Wl,--export-dynamic -o $@
  37. # -lphpcpp -L./ -Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive -l$(Service_Library_Name) -l$(Crypto_Library_Name) -lsgx_tstdc -lprotobuf -lssl -lcrypto
  38. #-lcrypto -lssl -L$(SGX_LIBRARY_PATH) -l$(Service_Library_Name) -l$(Crypto_Library_Name) -l$(Trts_Library_Name) -l$(SgxC_Library_Name) -lprotobuf
  39. # -Wl,-Bsymbolic -Wl,-pie,-eenclave_entry -Wl,--export-dynamic -Wl,--verbose -o $@