Makefile 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. CXX = g++
  2. RM = rm -f
  3. PYTHON_CFLAGS = -I/usr/include/python2.7 -I/usr/include/x86_64-linux-gnu/python2.7 -Wdate-time #-fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -DNDEBUG -g -fwrapv
  4. PYTHON_LDFLAGS = -L/usr/lib/python2.7/config-x86_64-linux-gnu -lpython2.7 -lutil #-ldl -lm #-Wl,-export-dynamic -Wl,-Bsymbolic-functions
  5. CXX_FLAGS = -Wall -O2 -std=c++11 -fpic -fdata-sections -ffunction-sections
  6. LD = ${CXX} -v
  7. LD_FLAGS = -Wall ${PYTHON_LDFLAGS}
  8. all_non_sgx_obj := $(system_obj) $(protobuf_obj) #$(patsubst %.cpp,%.o,$(all_non_sgx_cpp)}
  9. all_non_sgx_cpp := $(patsubst %.o,%.cpp,$(all_non_sgx_obj))
  10. sgx_protobuf_obj := $(patsubst %.cpp,%.o,$(wildcard SgxProtobuf*))
  11. sgx_obj := $(patsubst %.cpp,%.o,$(wildcard Sgx*))
  12. protobuf_obj := $(patsubst %.cpp,%.o,$(wildcard Protobuf*))
  13. system_obj := $(patsubst %.cpp,%.o,$(wildcard system*))
  14. OBJECTS := systemMain.o systemSealerWrapper.o SgxSealer.o ProtobufLAInitiator.o SgxProtobufLAInitiator.o SgxProtobufLAInitiator_Transforms.o ProtobufLAMessages.pb.o crypto.o
  15. SGX_SDK := /opt/intel/sgxsdk
  16. SGX_COMMON_CFLAGS := -m64
  17. SGX_LIBRARY_PATH := $(SGX_SDK)/lib64
  18. Trts_Library_Name := sgx_trts
  19. Service_Library_Name := sgx_tservice
  20. Crypto_Library_Name := sgx_tcrypto
  21. SGX_INCLUDE_PATHS := -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx
  22. Openssl_Path := /home/m2mazmud/plain-openssl
  23. Uae_Library_Name := sgx_uae_service
  24. all: verifier #${OBJECTS}
  25. clean:
  26. ${RM} *.obj *~* systemMain.o DeploymentStageLogic.o LAInitiator/LA.o LAInitiator/Transforms.o PostLA/PostLAMessaging.o ProtobufAutogenerated/ProtobufLAMessages.pb.o ProtobufMessageRW.o crypto.o
  27. LAInitiator/%.o: LAInitiator/%.cpp
  28. ${CXX} -I./include -I$(SGX_SDK)/include ${CXX_FLAGS} -c $^ -o $@
  29. PostLA/%.o: PostLA/%.cpp
  30. ${CXX} -I./include -I$(SGX_SDK)/include ${CXX_FLAGS} -c $^ -o $@
  31. ProtobufAutogenerated/%.o: ProtobufAutogenerated/%.cpp
  32. ${CXX} -I./include ${CXX_FLAGS} -c $^ -o $@
  33. %.o: %.cpp
  34. ${CXX} -I./include ${CXX_FLAGS} -c $^ -o $@
  35. #-I/usr/lib/jvm/java-8-openjdk-amd64/include/ -I/usr/lib/jvm/java-8-openjdk-amd64/include/linux/
  36. crypto.o: crypto.cpp
  37. ${CXX} -I${Openssl_Path}/include ${CXX_FLAGS} -c $^ -o $@
  38. verifier: systemMain.o DeploymentStageLogic.o LAInitiator/LA.o LAInitiator/Transforms.o PostLA/PostLAMessaging.o ProtobufAutogenerated/ProtobufLAMessages.pb.o ProtobufMessageRW.o crypto.o
  39. ${CXX} -Wl,--no-undefined systemMain.o DeploymentStageLogic.o LAInitiator/LA.o LAInitiator/Transforms.o PostLA/PostLAMessaging.o ProtobufAutogenerated/ProtobufLAMessages.pb.o ProtobufMessageRW.o crypto.o -L${Openssl_Path}/lib -lcrypto -lssl -L./ -l$(Service_Library_Name) -l$(Crypto_Library_Name) -L/home/m2mazmud/linux-sgx-trts-modified/build/linux -lsgx_tstdc -lsgx_trts ${LD_FLAGS} -lprotobuf -o $@
  40. #-L/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server -ljvm
  41. #-L~/linux-sgx-trts-modified/build/linux -lsgx_tstdc -lsgx_trts ${LD_FLAGS} -o $@
  42. #-Wl,-rpath,$(SGX_SDK)/lib64 systemMain.o ${LD_FLAGS} -o $@
  43. #systemSealerWrapper.o SgxSealer.o ProtobufLAInitiator.o SgxProtobufLAInitiator.o SgxProtobufLAInitiator_Transforms.o ProtobufLAMessages.pb.o crypto.o
  44. #${LD_FLAGS}
  45. #-L./ -Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive -L$(SGX_LIBRARY_PATH) -l$(Service_Library_Name) -l$(Crypto_Library_Name) -lsgx_tstdc
  46. # -lprotobuf
  47. # -L${Openssl_Path}/lib -lssl -lcrypto
  48. # -o $@
  49. # -L/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server -ljvm