proxmark3/client/android/CMakeLists.txt

225 lines
9.1 KiB
Text
Raw Normal View History

# version
message(STATUS "CMake ${CMAKE_VERSION}")
2020-05-06 18:03:37 +08:00
cmake_minimum_required(VERSION 3.4.1)
2020-05-08 22:36:35 +08:00
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -fvisibility=hidden -w")
2020-05-06 18:03:37 +08:00
# Root path into client
2020-05-06 18:03:37 +08:00
set(PM3_ROOT ../../)
add_subdirectory(../deps deps)
2020-07-03 16:46:40 +08:00
# Build zlib deps at external
if (CMAKE_MAKE_PROGRAM MATCHES ".*ninja.*")
set(BZIP2_INCLUDE_DIRS ${BZIP2_ROOT})
set(BZIP2_LIBRARIES pm3rrg_rdv4_bzip2)
elseif (UNIX) # Cross compile at Unix Makefile System.
# bzip2 dep.
include(ExternalProject)
set(CFLAGS_EXTERNAL_LIB "CFLAGS=--target=${CMAKE_C_COMPILER_TARGET} -w")
set(BZIP2_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/deps/bzip2/src/bzip2)
ExternalProject_Add(bzip2
GIT_REPOSITORY https://android.googlesource.com/platform/external/bzip2
GIT_TAG platform-tools-30.0.2
PREFIX deps/bzip2
#SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/deps/bzip2
CONFIGURE_COMMAND mkdir -p ${BZIP2_BUILD_DIR} && git archive --format tar HEAD | tar -C ${BZIP2_BUILD_DIR} -x
BUILD_IN_SOURCE ON
BUILD_COMMAND make -C ${BZIP2_BUILD_DIR} -j4 CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} LD=${CMAKE_C_COMPILER} AR=${CMAKE_AR} RANLIB=${CMAKE_RANLIB} ${CFLAGS_EXTERNAL_LIB} libbz2.a
INSTALL_COMMAND ""
LOG_DOWNLOAD ON
)
ExternalProject_Add_StepTargets(bzip2 configure build install)
set(BZIP2_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/deps/bzip2/src/bzip2)
set(BZIP2_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/deps/bzip2/src/bzip2/libbz2.a)
else ()
message(ERROR "Please implement your BZIP2 import.")
endif ()
# client resources
2020-05-06 18:03:37 +08:00
add_library(pm3rrg_rdv4 SHARED
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/common/commonutil.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/common/util_posix.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/common/parity.c
${PM3_ROOT}/common/bucketsort.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/common/crapto1/crapto1.c
${PM3_ROOT}/common/crapto1/crypto1.c
${PM3_ROOT}/common/crc.c
${PM3_ROOT}/common/crc16.c
${PM3_ROOT}/common/crc32.c
${PM3_ROOT}/common/crc64.c
${PM3_ROOT}/common/lfdemod.c
${PM3_ROOT}/common/legic_prng.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/common/iso15693tools.c
${PM3_ROOT}/common/cardhelper.c
${PM3_ROOT}/common/generator.c
${PM3_ROOT}/client/src/crypto/asn1dump.c
${PM3_ROOT}/client/src/crypto/asn1utils.c
${PM3_ROOT}/client/src/crypto/libpcrypto.c
${PM3_ROOT}/client/src/emv/test/cda_test.c
${PM3_ROOT}/client/src/emv/test/crypto_test.c
${PM3_ROOT}/client/src/emv/test/cryptotest.c
${PM3_ROOT}/client/src/emv/test/dda_test.c
${PM3_ROOT}/client/src/emv/test/sda_test.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/client/src/emv/cmdemv.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/emv/crypto.c
${PM3_ROOT}/client/src/emv/crypto_polarssl.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/client/src/emv/dol.c
${PM3_ROOT}/client/src/emv/emv_pk.c
${PM3_ROOT}/client/src/emv/emv_pki.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/emv/emv_pki_priv.c
${PM3_ROOT}/client/src/emv/emv_roca.c
${PM3_ROOT}/client/src/emv/emv_tags.c
${PM3_ROOT}/client/src/emv/emvcore.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/client/src/emv/emvjson.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/emv/tlv.c
${PM3_ROOT}/client/src/fido/additional_ca.c
${PM3_ROOT}/client/src/fido/cbortools.c
${PM3_ROOT}/client/src/fido/cose.c
${PM3_ROOT}/client/src/fido/fidocore.c
${PM3_ROOT}/client/src/iso7816/apduinfo.c
${PM3_ROOT}/client/src/iso7816/iso7816core.c
${PM3_ROOT}/client/src/cipurse/cipursecrypto.c
${PM3_ROOT}/client/src/cipurse/cipursecore.c
${PM3_ROOT}/client/src/cipurse/cipursetest.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/loclass/cipher.c
${PM3_ROOT}/client/src/loclass/cipherutils.c
${PM3_ROOT}/client/src/loclass/elite_crack.c
${PM3_ROOT}/client/src/loclass/hash1_brute.c
${PM3_ROOT}/client/src/loclass/ikeys.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/client/src/mifare/mad.c
${PM3_ROOT}/client/src/mifare/aiddesfire.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/client/src/mifare/mfkey.c
${PM3_ROOT}/client/src/mifare/mifare4.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/mifare/mifaredefault.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/client/src/mifare/mifarehost.c
2021-05-29 04:35:42 +08:00
${PM3_ROOT}/client/src/nfc/ndef.c
${PM3_ROOT}/client/src/mifare/lrpcrypto.c
${PM3_ROOT}/client/src/mifare/desfirecrypto.c
${PM3_ROOT}/client/src/mifare/desfiresecurechan.c
${PM3_ROOT}/client/src/mifare/desfirecore.c
${PM3_ROOT}/client/src/mifare/desfiretest.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/uart/uart_posix.c
${PM3_ROOT}/client/src/uart/uart_win32.c
${PM3_ROOT}/client/src/ui/overlays.ui
${PM3_ROOT}/client/src/ui/image.ui
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/aidsearch.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/client/src/cmdanalyse.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/cmdcrc.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/client/src/cmddata.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/cmdflashmem.c
${PM3_ROOT}/client/src/cmdflashmemspiffs.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/client/src/cmdhf.c
${PM3_ROOT}/client/src/cmdhf14a.c
${PM3_ROOT}/client/src/cmdhf14b.c
${PM3_ROOT}/client/src/cmdhf15.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/cmdhfcryptorf.c
${PM3_ROOT}/client/src/cmdhfemrtd.c
2021-04-20 18:07:52 +08:00
${PM3_ROOT}/client/src/cmdhfepa.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/client/src/cmdhffelica.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/cmdhffido.c
${PM3_ROOT}/client/src/cmdhfcipurse.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/client/src/cmdhficlass.c
2021-04-20 18:07:52 +08:00
${PM3_ROOT}/client/src/cmdhfjooki.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/cmdhflegic.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/client/src/cmdhflist.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/cmdhflto.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/client/src/cmdhfmf.c
${PM3_ROOT}/client/src/cmdhfmfdes.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/cmdhfmfhard.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/client/src/cmdhfmfp.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/cmdhfmfu.c
${PM3_ROOT}/client/src/cmdhfseos.c
2020-09-13 07:33:32 +08:00
${PM3_ROOT}/client/src/cmdhfst.c
2021-05-30 20:55:58 +08:00
${PM3_ROOT}/client/src/cmdhfst25ta.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/cmdhfthinfilm.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/client/src/cmdhftopaz.c
${PM3_ROOT}/client/src/cmdhfwaveshare.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/client/src/cmdhw.c
${PM3_ROOT}/client/src/cmdlf.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/cmdlfawid.c
${PM3_ROOT}/client/src/cmdlfcotag.c
2020-10-12 18:27:00 +08:00
${PM3_ROOT}/client/src/cmdlfdestron.c
${PM3_ROOT}/client/src/cmdlfem.c
${PM3_ROOT}/client/src/cmdlfem410x.c
2020-10-26 16:30:05 +08:00
${PM3_ROOT}/client/src/cmdlfem4x05.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/cmdlfem4x50.c
${PM3_ROOT}/client/src/cmdlfem4x70.c
${PM3_ROOT}/client/src/cmdlffdxb.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/cmdlfgallagher.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/client/src/cmdlfguard.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/cmdlfhid.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/client/src/cmdlfhitag.c
2020-09-29 03:09:26 +08:00
${PM3_ROOT}/client/src/cmdlfidteck.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/cmdlfindala.c
${PM3_ROOT}/client/src/cmdlfio.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/client/src/cmdlfjablotron.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/cmdlfkeri.c
${PM3_ROOT}/client/src/cmdlfmotorola.c
${PM3_ROOT}/client/src/cmdlfnedap.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/client/src/cmdlfnexwatch.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/cmdlfnoralsy.c
${PM3_ROOT}/client/src/cmdlfpac.c
${PM3_ROOT}/client/src/cmdlfparadox.c
${PM3_ROOT}/client/src/cmdlfpcf7931.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/client/src/cmdlfpresco.c
${PM3_ROOT}/client/src/cmdlfpyramid.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/cmdlfsecurakey.c
${PM3_ROOT}/client/src/cmdlft55xx.c
${PM3_ROOT}/client/src/cmdlfti.c
${PM3_ROOT}/client/src/cmdlfviking.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/client/src/cmdlfvisa2000.c
${PM3_ROOT}/client/src/cmdmain.c
2021-05-29 04:35:42 +08:00
${PM3_ROOT}/client/src/cmdnfc.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/cmdparser.c
${PM3_ROOT}/client/src/cmdscript.c
${PM3_ROOT}/client/src/cmdsmartcard.c
${PM3_ROOT}/client/src/cmdtrace.c
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/client/src/cmdusart.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/cmdwiegand.c
${PM3_ROOT}/client/src/comms.c
${PM3_ROOT}/client/src/fileutils.c
${PM3_ROOT}/client/src/flash.c
${PM3_ROOT}/client/src/graph.c
2020-05-25 03:51:39 +08:00
${PM3_ROOT}/client/src/jansson_path.c
2020-07-03 16:46:40 +08:00
${PM3_ROOT}/client/src/preferences.c
${PM3_ROOT}/client/src/pm3_binlib.c
${PM3_ROOT}/client/src/pm3_bitlib.c
${PM3_ROOT}/client/src/prng.c
${PM3_ROOT}/client/src/scandir.c
${PM3_ROOT}/client/src/scripting.c
${PM3_ROOT}/client/src/tea.c
${PM3_ROOT}/client/src/ui.c
${PM3_ROOT}/client/src/util.c
${PM3_ROOT}/client/src/wiegand_formats.c
${PM3_ROOT}/client/src/wiegand_formatutils.c
# android resources
2020-05-06 18:03:37 +08:00
jni_tools.c
pm3_main.c
)
# includes
2020-05-06 18:03:37 +08:00
target_include_directories(pm3rrg_rdv4 PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
2020-07-03 16:46:40 +08:00
${BZIP2_INCLUDE_DIRS}
2020-05-06 18:03:37 +08:00
${PM3_ROOT}/common
${PM3_ROOT}/common_fpga
${PM3_ROOT}/include
${PM3_ROOT}/client/src
${PM3_ROOT}/client/include
2021-09-06 01:51:08 +08:00
)
target_link_libraries(pm3rrg_rdv4
2020-07-03 16:46:40 +08:00
${BZIP2_LIBRARIES}
2020-05-08 21:56:32 +08:00
pm3rrg_rdv4_hardnested
pm3rrg_rdv4_mbedtls
pm3rrg_rdv4_cliparser
pm3rrg_rdv4_jansson
pm3rrg_rdv4_lua
pm3rrg_rdv4_tinycbor
pm3rrg_rdv4_amiibo
pm3rrg_rdv4_reveng
pm3rrg_rdv4_whereami
android
2020-09-29 03:09:26 +08:00
log)