Makefile 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. SGX_INCLUDE_PATHS := -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx
  14. Uae_Library_Name := sgx_uae_service
  15. all: localattestation_decryption.so #${OBJECTS}
  16. clean:
  17. ${RM} *.obj *~* ${OBJECTS} localattestation_decryption.so
  18. Protobuf%.o: Protobuf%.cpp
  19. ${CXX} -I./include ${CXX_FLAGS} -c $^ -o $@
  20. PostLAMessages.pb.o: PostLAMessages.pb.cpp
  21. ${CXX} -I./include ${CXX_FLAGS} -c $^ -o $@
  22. system%.o: system%.cpp
  23. g++ -I./include ${CXX_FLAGS} -c $^ -o $@
  24. MainLogic.o: MainLogic.cpp
  25. g++ -I./include ${CXX_FLAGS} -c $^ -o $@
  26. PostLA/%.o: PostLA/%.cpp
  27. g++ -I./include -I$(SGX_SDK)/include ${CXX_FLAGS} -c $^ -o $@
  28. LAInitiator/%.o: LAInitiator/%.cpp
  29. g++ -I./include -I$(SGX_SDK)/include ${CXX_FLAGS} -c $^ -o $@
  30. ProtobufMessageRW.o: ProtobufMessageRW.cpp
  31. g++ -I./include ${CXX_FLAGS} -c $^ -o $@
  32. crypto.o: crypto.cpp
  33. g++ ${CXX_FLAGS} -c $^ -o $@
  34. 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
  35. ${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 -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 -Wl,-Bsymbolic -Wl,-pie,-eenclave_entry -Wl,--export-dynamic -o $@
  36. # -Wl,-Bsymbolic -Wl,-pie,-eenclave_entry -Wl,--export-dynamic -Wl,--verbose -o $@