12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- CXX = g++
- RM = rm -f
- CXX_FLAGS = -Wall -O2 -std=c++11 -fpic -fdata-sections -ffunction-sections
- LD = ${CXX} -v
- LD_FLAGS = -Wall -shared -O2
- #all_non_sgx_cpp := $(filter-out((wildcard *.cpp), $(sgx_cpp))) #main.cpp ipc.cpp SealerWrapper.cpp ProtobufLAMessages.cpp ProtobufSealerMessages.cpp
- all_non_sgx_obj := $(system_obj) $(protobuf_obj) #$(patsubst %.cpp,%.o,$(all_non_sgx_cpp)}
- #main_system_and_wrapper_cpp = $(filter-out(wildcard *.cpp, $(sgx_cpp) $(protobuf_cpp) $(protobuf_sgx_cpp)))
- #sgx_cpp = $(wildcard Sgx*)
- all_non_sgx_cpp := $(patsubst %.o,%.cpp,$(all_non_sgx_obj))
- sgx_protobuf_obj := $(patsubst %.cpp,%.o,$(wildcard SgxProtobuf*))
- sgx_obj := $(patsubst %.cpp,%.o,$(wildcard Sgx*))
- #sgx_only_obj := $(filter-out($(sgx_obj), $(sgx_protobuf_obj)))
- protobuf_obj := $(patsubst %.cpp,%.o,$(wildcard Protobuf*))
- system_obj := $(patsubst %.cpp,%.o,$(wildcard system*))
- OBJECTS := systemMain.o systemIpc.o systemSealerWrapper.o SgxCrypto.o SgxSealer.o SgxLAInitiator.o ${sgx_protobuf_obj} ${protobuf_obj} #$(system_obj) $(sgx_only_obj) $(sgx_protobuf_obj) $(protobuf_obj)
- SGX_SDK := /home/m2mazmud/sgx2.1_installation/sgxsdk
- SGX_COMMON_CFLAGS := -m64
- SGX_LIBRARY_PATH := $(SGX_SDK)/lib64
- Trts_Library_Name := sgx_trts
- Service_Library_Name := sgx_tservice
- Crypto_Library_Name := sgx_tcrypto
- SGX_INCLUDE_PATHS := -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx
- Uae_Library_Name := sgx_uae_service
- all: verifier ${OBJECTS}
- #${RESULT}: ${OBJECTS} ${LocalAttestationCode_objects} ${LocalAttestationCode_ipc_objects} ${LocalAttestationCode_serialization_objects}
- # $(LD) $(LD_FLAGS) -o $@ $^ -Wl,--no-undefined -lphpcpp -lprotobuf -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 -Wl,-Bsymbolic -Wl,-pie,-eenclave_entry -Wl,--export-dynamic -Wl,--defsym,__ImageBase=0 -Wl,--gc-sections
- clean:
- ${RM} *.obj *~* ${OBJECTS} verifier #${LocalAttestationCode_objects} ${LocalAttestationCode_ipc_objects} ${LocalAttestationCode_serialization_objects}
- #SgxLAInititator.o and SgxSealer.o
- #SgxLAInititator.o: SgxLAInititator.cpp
- # ${CXX} -I./include -I$(SGX_SDK)/include ${CXX_FLAGS} -c $^ -o $@ #TODO: Else try sgx_include_paths
- #SgxSealer.o: SgxSealer.cpp
- # ${CXX} -I./include -I$(SGX_SDK)/include ${CXX_FLAGS} -c $^ -o $@
- #ProtobufSgxLATransforms_Inititator.o and ProtobufSgxSealerTransforms.o
- #ProtobufSgxLATransforms_Inititator.o: ProtobufSgxLATransforms_Inititator.cpp
- # ${CXX} -I./include -I$(SGX_SDK)/include ${CXX_FLAGS} -c $^ -o $@
- #ProtobufSgxSealerTransforms.o: ProtobufSgxSealerTransforms.cpp
- # ${CXX} -I./include -I$(SGX_SDK)/include ${CXX_FLAGS} -c $^ -o $@
- Sgx%.o: Sgx%.cpp
- ${CXX} -I./include -I$(SGX_SDK)/include ${CXX_FLAGS} -c $^ -o $@
- #SgxSealer.o: SgxSealer.cpp
- # ${CXX} -I./include -I$(SGX_SDK)/include ${CXX_FLAGS} -c $^ -o $@
- #SgxLAInititator.o: SgxLAInititator
- #$(all_non_sgx_obj): $(all_non_sgx_cpp)
- # ${CXX} -I./include ${CXX_FLAGS} -c $^ -o $@
- Protobuf%.o: Protobuf%.cpp
- ${CXX} -I./include ${CXX_FLAGS} -c $^ -o $@
- system%.o: system%.cpp
- gcc -I./include ${CXX_FLAGS} -c $^ -o $@
- #system%.o: system%.s
- # gcc ${CXX_FLAGS} -o $@ $^
- verifier: systemMain.o systemIpc.o systemSealerWrapper.o SgxSealer.o SgxLAInitiator.o ${sgx_protobuf_obj} ${protobuf_obj}
- # echo $(system_obj)
- ${CXX} ${CXX_FLAGS} systemMain.o systemIpc.o systemSealerWrapper.o SgxSealer.o SgxLAInitiator.o ${sgx_protobuf_obj} -L./ -Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive -L$(SGX_LIBRARY_PATH) -l$(Service_Library_Name) -l$(Crypto_Library_Name) -l$(Uae_Library_Name) -lsgx_tstdc -lsgx_urts ${protobuf_obj} -lprotobuf -lsgx_tstdcxx -Wl,--verbose -o $@
|