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 INCLUDEDIRS = -I../../../../third_party/tpm-emulator/tpmd/unix | 5 INCLUDEDIRS = -I../../../../third_party/tpm-emulator/tpmd/unix |
6 LOCAL_CFLAGS = -g -Wall -Werror $(INCLUDEDIRS) | 6 LOCAL_CFLAGS = -g -Wall -Werror $(INCLUDEDIRS) |
7 CFLAGS += $(LOCAL_CFLAGS) | 7 CFLAGS += $(LOCAL_CFLAGS) |
8 # CFLAGS += -ansi -pedantic | 8 # CFLAGS += -ansi -pedantic |
9 ifeq ($(USE_TPM_EMULATOR),1) | 9 ifeq ($(USE_TPM_EMULATOR),1) |
10 CFLAGS += -DUSE_TPM_EMULATOR=1 | 10 CFLAGS += -DUSE_TPM_EMULATOR=1 |
11 else | 11 else |
12 CFLAGS += -DUSE_TPM_EMULATOR=0 | 12 CFLAGS += -DUSE_TPM_EMULATOR=0 |
13 endif | 13 endif |
14 | 14 |
15 CC ?= cc | 15 CC ?= cc |
16 HOSTCC = cc | 16 HOSTCC = cc |
17 | 17 |
18 libtlcl.a: tlcl.o | 18 libtlcl.a: tlcl.o |
19 ar rcs libtlcl.a tlcl.o | 19 ar rcs libtlcl.a tlcl.o |
20 | 20 |
21 tlcl.o: tlcl.c tlcl_internal.h tlcl.h structures.h | 21 tlcl.o: tlcl.c tlcl_internal.h tlcl.h \ |
| 22 » update-structures structures.h update-version version.h |
22 | 23 |
23 structures.h: generator | 24 update-structures: generator |
24 » ./generator > structures.h | 25 » ./generator > structures.tmp |
25 » sed -e '0,/This file is automatically/d' < structures.h > x.tmp | 26 » cmp -s structures.tmp structures.h || \ |
26 » sed -e '0,/This file is automatically/d' < saved-structures.h > y.tmp | 27 » » ( echo "%% Updating structures.h %%" && \ |
27 » cmp -s x.tmp y.tmp || \ | 28 » » cp structures.tmp structures.h ) |
28 » » (echo "Please update saved-structures.h" && false) | 29 |
| 30 update-version: |
| 31 » find \( -name '*.[ch]' -o -name 'Makefile*' \) -a \! -name version.h \ |
| 32 » » | sort | xargs cat | md5sum | cut -c 25-32 > x.tmp |
| 33 » echo "char* TlclVersion = \"TLCLv=$$(cat x.tmp)\";" > version.tmp |
| 34 » cmp -s version.tmp version.h || \ |
| 35 » » ( echo "** Updating version.h **" && cp version.tmp version.h ) |
29 | 36 |
30 generator: generator.c tlcl.h | 37 generator: generator.c tlcl.h |
31 $(HOSTCC) $(LOCAL_CFLAGS) -I$(ROOT)/usr/include \ | 38 $(HOSTCC) $(LOCAL_CFLAGS) -I$(ROOT)/usr/include \ |
32 -fpack-struct generator.c -o generator | 39 -fpack-struct generator.c -o generator |
33 | 40 |
34 clean: | 41 clean: |
35 » rm -f generator *.o *.a structures.h x.tmp y.tmp *~ | 42 » rm -f generator *.o *.a version.tmp structures.tmp x.tmp *~ |
OLD | NEW |