Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | # Copyright (C) 2017 Kurt Bodiker <kurt.bodiker@braintrust-us.com> |
| 2 | # Released under the MIT license (see COPYING.MIT for the terms) |
| 3 | |
| 4 | require stubdom.inc |
| 5 | |
| 6 | DEPENDS += "\ |
| 7 | cmake-native \ |
| 8 | newlib \ |
| 9 | stubdom-gmp \ |
| 10 | " |
| 11 | |
| 12 | # nothing to configure |
| 13 | do_configure[noexec] = "1" |
| 14 | |
| 15 | export CMAKE_C_FLAGS = "\ |
| 16 | -std=c99 \ |
| 17 | -DTPM_NO_EXTERN \ |
| 18 | ${STUBDOM_CPPFLAGS} \ |
| 19 | ${STUBDOM_CFLAGS} \ |
| 20 | -Wno-declaration-after-statement \ |
| 21 | -Wno-implicit-fallthrough \ |
| 22 | " |
| 23 | |
| 24 | do_compile() { |
| 25 | CC="${HOST_PREFIX}gcc --sysroot=${RECIPE_SYSROOT}" cmake .. -DCMAKE_C_FLAGS:STRING="${CMAKE_C_FLAGS}" |
| 26 | ${MAKE} VERBOSE=1 tpm_crypto tpm |
| 27 | } |
| 28 | |
| 29 | do_install() { |
| 30 | install -d ${D}/${libdir} |
| 31 | install -m 644 -t ${D}/${libdir} ${B}/crypto/libtpm_crypto.a |
| 32 | install -m 644 -t ${D}/${libdir} ${B}/tpm/libtpm.a |
| 33 | |
| 34 | install -D -m 644 -t ${D}/${includedir}/tpm-emulator/build ${S}/build/config.h |
| 35 | install -D -m 644 -t ${D}/${includedir}/tpm-emulator/crypto ${S}/crypto/*.h |
| 36 | install -D -m 644 -t ${D}/${includedir}/tpm-emulator/tpm ${S}/tpm/*.h |
| 37 | } |