corda/sgx-jvm/remote-attestation/host/Makefile
Tommy Lillehagen 83d6a248a8
ENT-970 - SGX remote attestation host (#173)
* ENT-970 - SGX remote attestation host
 * Remote attestation enclave
 * Client for the remote attestation host
    * Communicates with ISV / RA server, which in turn communicates with
      the Intel Attestation Service
    * Native library bridging the client code running on the JVM with
      the native bits controlling and communicating with the enclave

* ENT-970 - Address comments from code review
* ENT-970 - More updates addressing review comments
* ENT-970 - Integrate with root Gradle project for SGX
2017-12-13 17:45:33 +00:00

73 lines
2.3 KiB
Makefile

.PHONY: host host-native docs \
unit-tests unit-tests-force \
integration-tests integration-tests-force \
run run-local run-remote run-sgx \
clean
# === GENERAL PARAMETERS ==========================================================================
SHELL = /bin/bash
MAKEFILE_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
GRADLE ?= $(MAKEFILE_DIR)/../gradlew
# TODO Update to Dokka 0.9.16 (when available) to fix: https://github.com/Kotlin/dokka/issues/184
DOKKA_FILTER = grep -v "Can't find node by signature"
# === PSEUDO TARGETS ==============================================================================
host:
$(GRADLE) compileKotlin
host-native:
make -C native all
docs:
$(GRADLE) dokka | $(DOKKA_FILTER)
docs-force:
rm -rf $(MAKEFILE_DIR)/build/javadoc
$(GRADLE) dokka | $(DOKKA_FILTER)
unit-tests: host-native
$(GRADLE) test
unit-tests-force: host-native
$(GRADLE) cleanTest test
integration-tests: host-native
$(GRADLE) integrationTest
integration-tests-force: host-native
$(GRADLE) cleanIntegrationTest integrationTest
~/.classpath:
$(GRADLE) -q getClasspath > ~/.classpath
clean:
$(GRADLE) clean
rm -f ~/.classpath
# === TEST TARGETS ================================================================================
JAVA_PROG = $(JAVA_HOME)/bin/java
SGX_GDB = /sgx/sgxsdk/bin/sgx-gdb
HOST = localhost:2000
MAIN_CLASS = net.corda.sgx.cli.Program
JVM_DEFS = -Dcorda.sgx.enclave.path=/code/sgx-jvm/remote-attestation/enclave/build \
-Djava.library.path=/code/sgx-jvm/remote-attestation/host/native/build \
-Dfile.encoding=US-ASCII -Duser.country=US -Duser.language=en -Duser.variant \
-Dattestation.home=/code/sgx-jvm/remote-attestation/host/build/logs
JVM_ARGS = -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
run: ~/.classpath
$(JAVA_PROG) $(JVM_DEFS) $(JVM_ARGS) -cp `cat ~/.classpath` $(MAIN_CLASS)
run-local: ~/.classpath
gdb --args $(JAVA_PROG) $(JVM_DEFS) $(JVM_ARGS) -cp `cat ~/.classpath` $(MAIN_CLASS)
run-sgx: ~/.classpath
$(SGX_GDB) --args $(JAVA_PROG) $(JVM_DEFS) $(JVM_ARGS) -cp `cat ~/.classpath` $(MAIN_CLASS)
run-remote: ~/.classpath
gdbserver $(HOST) $(JAVA_PROG) $(JVM_DEFS) $(JVM_ARGS) -cp `cat ~/.classpath` $(MAIN_CLASS)