OLD | NEW |
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 LIBTLCL = ../tlcl/libtlcl.a | 5 LIBTLCL = ../tlcl/libtlcl.a |
6 | 6 |
7 ifeq ($(USE_TPM_EMULATOR),1) | 7 ifeq ($(USE_TPM_EMULATOR),1) |
8 ifeq ($(LOCAL_COMPILATION),1) | 8 ifeq ($(LOCAL_COMPILATION),1) |
9 LIBTPM = ../../../../third_party/tpm-emulator/build/tpm/libtpm.a | 9 LIBTPM = ../../../../third_party/tpm-emulator/build/tpm/libtpm.a |
10 LIBCRYPTO = ../../../../third_party/tpm-emulator/build/crypto/libcrypto.a | 10 LIBCRYPTO = ../../../../third_party/tpm-emulator/build/crypto/libcrypto.a |
11 LIBTPMEMU = ../../../../third_party/tpm-emulator/build/tpmd/unix/libtpmemu.a | 11 LIBTPMEMU = ../../../../third_party/tpm-emulator/build/tpmd/unix/libtpmemu.a |
12 else | 12 else |
13 LIBTPM = ${ROOT}/usr/lib/tpmemu/libtpm.a | 13 LIBTPM = ${ROOT}/usr/lib/tpmemu/libtpm.a |
14 LIBCRYPTO = ${ROOT}/usr/lib/tpmemu/libcrypto.a | 14 LIBCRYPTO = ${ROOT}/usr/lib/tpmemu/libcrypto.a |
15 LIBTPMEMU = ${ROOT}/usr/lib/tpmemu/libtpmemu.a | 15 LIBTPMEMU = ${ROOT}/usr/lib/tpmemu/libtpmemu.a |
16 endif | 16 endif |
17 LIBGMP = -lgmp | 17 LIBGMP = -lgmp |
18 endif | 18 endif |
19 | 19 |
20 LIBS = $(LIBTLCL) $(LIBTPMEMU) $(LIBTPM) $(LIBCRYPTO) $(LIBGMP) | 20 LIBS = $(LIBTLCL) $(LIBTPMEMU) $(LIBTPM) $(LIBCRYPTO) $(LIBGMP) |
21 | 21 |
22 CC ?= cc | 22 CC ?= cc |
23 CFLAGS += -Werror -Wall | 23 CFLAGS += -Werror -Wall |
24 #CFLAGS += -pedantic -ansi | 24 #CFLAGS += -pedantic -ansi |
25 | 25 |
26 TESTS = tpmtest_readonly | 26 TESTS = tpmtest_readonly tpmtest_clear tpmtest_writelimit tpmtest_lock |
27 | 27 |
28 all: $(TESTS) | 28 all: $(TESTS) |
29 | 29 |
30 $(TESTS): tpmtest_%: %.o $(LIBS) | 30 $(TESTS): tpmtest_%: %.o $(LIBS) |
31 $(CC) $(LDFLAGS) -g $< -o $@ $(LIBS) | 31 $(CC) $(LDFLAGS) -g $< -o $@ $(LIBS) |
32 | 32 |
33 .c.o: | 33 .c.o: |
34 $(CC) $(CFLAGS) -g -c $< -I../include | 34 $(CC) $(CFLAGS) -g -c $< -I../include |
35 | 35 |
36 clean: | 36 clean: |
37 rm -f $(TESTS) *.o *~ | 37 rm -f $(TESTS) *.o *~ |
OLD | NEW |