Index: src/platform/tpm_lite/src/testsuite/Makefile |
diff --git a/src/platform/tpm_lite/src/testsuite/Makefile b/src/platform/tpm_lite/src/testsuite/Makefile |
index c646a6b68d996490cf97cfeb45ae6ea0f121ea93..0211af598c9668934a38a23f17d4857a5c4d1a69 100644 |
--- a/src/platform/tpm_lite/src/testsuite/Makefile |
+++ b/src/platform/tpm_lite/src/testsuite/Makefile |
@@ -3,18 +3,35 @@ |
# found in the LICENSE file. |
LIBTLCL = ../tlcl/libtlcl.a |
+ |
+ifeq ($(USE_TPM_EMULATOR),1) |
+ifeq ($(LOCAL_COMPILATION),1) |
LIBTPM = ../../../../third_party/tpm-emulator/build/tpm/libtpm.a |
LIBCRYPTO = ../../../../third_party/tpm-emulator/build/crypto/libcrypto.a |
LIBTPMEMU = ../../../../third_party/tpm-emulator/build/tpmd/unix/libtpmemu.a |
-LIBS = $(LIBTLCL) $(LIBTPMEMU) $(LIBTPM) $(LIBCRYPTO) |
+else |
+LIBTPM = ${ROOT}/usr/lib/tpmemu/libtpm.a |
+LIBCRYPTO = ${ROOT}/usr/lib/tpmemu/libcrypto.a |
+LIBTPMEMU = ${ROOT}/usr/lib/tpmemu/libtpmemu.a |
+endif |
+LIBGMP = -lgmp |
+endif |
+ |
+LIBS = $(LIBTLCL) $(LIBTPMEMU) $(LIBTPM) $(LIBCRYPTO) $(LIBGMP) |
CC ?= cc |
+CFLAGS += -Werror -Wall |
+#CFLAGS += -pedantic -ansi |
+ |
+TESTS = tpmtest_readonly |
+ |
+all: $(TESTS) |
-readonly: readonly.o $(LIBS) |
- $(CC) -g readonly.o -o readonly $(LIBS) -lgmp |
+$(TESTS): tpmtest_%: %.o $(LIBS) |
+ $(CC) $(LDFLAGS) -g $< -o $@ $(LIBS) |
-readonly.o: readonly.c |
- cc -g -c -Werror -Wall -pedantic -ansi readonly.c -I../include |
+.c.o: |
+ $(CC) $(CFLAGS) -g -c $< -I../include |
clean: |
- rm -f readonly *.o *~ |
+ rm -f $(TESTS) *.o *~ |