Makefile 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 -Wl,--verbose
  6. OBJECTS := systemMain.o ProtobufLAInitiator.o SgxProtobufLAInitiator.o SgxProtobufLAInitiator_Transforms.o ProtobufLAMessages.pb.o crypto.o
  7. #SGX_SDK := /home/m2mazmud/sgx2.1_installation/sgxsdk
  8. SGX_SDK := /opt/intel/sgxsdk
  9. SGX_COMMON_CFLAGS := -m64
  10. SGX_LIBRARY_PATH := $(SGX_SDK)/lib64
  11. Trts_Library_Name := sgx_trts
  12. Service_Library_Name := sgx_tservice
  13. Crypto_Library_Name := sgx_tcrypto
  14. SGX_INCLUDE_PATHS := -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx
  15. Openssl_Path := /home/m2mazmud/plain-openssl
  16. Uae_Library_Name := sgx_uae_service
  17. all: localattestation_decryption.so ${OBJECTS}
  18. clean:
  19. ${RM} *.obj *~* ${OBJECTS} localattestation_decryption.so
  20. Sgx%.o: Sgx%.cpp
  21. ${CXX} -I./include -I$(SGX_SDK)/include ${CXX_FLAGS} -c $^ -o $@
  22. Protobuf%.o: Protobuf%.cpp
  23. ${CXX} -I./include ${CXX_FLAGS} -c $^ -o $@
  24. PostLAMessages.pb.o: PostLAMessages.pb.cpp
  25. ${CXX} -I./include ${CXX_FLAGS} -c $^ -o $@
  26. system%.o: system%.cpp
  27. g++ -I./include ${CXX_FLAGS} -c $^ -o $@
  28. crypto.o: crypto.cpp
  29. g++ -I${Openssl_Path}/include ${CXX_FLAGS} -c $^ -o $@
  30. localattestation_decryption.so: systemMain.o ProtobufLAInitiator.o SgxProtobufLAInitiator.o SgxProtobufLAInitiator_Transforms.o ProtobufLAMessages.pb.o PostLAMessages.pb.o crypto.o
  31. ${CXX} ${LD_FLAGS} systemMain.o ProtobufLAInitiator.o SgxProtobufLAInitiator.o SgxProtobufLAInitiator_Transforms.o ProtobufLAMessages.pb.o PostLAMessages.pb.o crypto.o -lphpcpp -L./ -Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive -l$(Service_Library_Name) -l$(Crypto_Library_Name) -lsgx_tstdc -lprotobuf -Wl,--rpath /home/m2mazmud/plain-openssl/lib -L${Openssl_Path}/lib -lssl -lcrypto -Wl,-Bsymbolic -Wl,-pie,-eenclave_entry -Wl,--export-dynamic -o $@
  32. #ProtobufLAInitiator.o SgxProtobufLAInitiator.o SgxProtobufLAInitiator_Transforms.o ProtobufLAMessages.pb.o crypto.o
  33. # -L./ -Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive -l$(Service_Library_Name) -l$(Crypto_Library_Name) -lsgx_tstdc -lprotobuf -Wl,--rpath /home/m2mazmud/plain-openssl/lib -L${Openssl_Path}/lib -lssl -lcrypto -Wl,-Bsymbolic -Wl,-pie,-eenclave_entry -Wl,--export-dynamic -Wl,--verbose -lphpcpp -lprotobuf -o $@
  34. #ProtobufLAInitiator.o SgxProtobufLAInitiator.o SgxProtobufLAInitiator_Transforms.o ProtobufLAMessages.pb.o crypto.o
  35. # -L./ -Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive -l$(Service_Library_Name) -l$(Crypto_Library_Name) -lsgx_tstdc
  36. # -lprotobuf
  37. # -L${Openssl_Path}/lib -lssl -lcrypto
  38. # -lphpcpp
  39. # -Wl,-Bsymbolic -Wl,-pie,-eenclave_entry -Wl,--export-dynamic -Wl,--verbose -o $@
  40. #-Wl,--rpath /home/m2mazmud/plain-openssl/lib -o $@