Makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. CXX = g++
  2. RM = rm -f
  3. CXX_FLAGS = -Wall -O2 -std=c++11 -fpic #-fdata-sections -ffunction-sections
  4. LD = ${CXX} -v
  5. LD_FLAGS = -Wall -shared
  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. system%.o: system%.cpp
  25. g++ -I./include ${CXX_FLAGS} -c $^ -o $@
  26. crypto.o: crypto.cpp
  27. g++ -I${Openssl_Path}/include ${CXX_FLAGS} -c $^ -o $@
  28. localattestation_decryption.so: systemMain.o ProtobufLAInitiator.o SgxProtobufLAInitiator.o SgxProtobufLAInitiator_Transforms.o ProtobufLAMessages.pb.o crypto.o
  29. ${CXX} ${LD_FLAGS} -Wl,--no-undefined systemMain.o ProtobufLAInitiator.o SgxProtobufLAInitiator.o SgxProtobufLAInitiator_Transforms.o ProtobufLAMessages.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 $@
  30. #ProtobufLAInitiator.o SgxProtobufLAInitiator.o SgxProtobufLAInitiator_Transforms.o ProtobufLAMessages.pb.o crypto.o
  31. # -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 $@
  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
  34. # -lprotobuf
  35. # -L${Openssl_Path}/lib -lssl -lcrypto
  36. # -lphpcpp
  37. # -Wl,-Bsymbolic -Wl,-pie,-eenclave_entry -Wl,--export-dynamic -Wl,--verbose -o $@
  38. #-Wl,--rpath /home/m2mazmud/plain-openssl/lib -o $@