added more keys (@equipter)
[RRG-proxmark3.git] / client / android / CMakeLists.txt
blob262403be73f55f85eb7ae716db73bdb7c14fe189
1 # version
2 message(STATUS "CMake ${CMAKE_VERSION}")
3 cmake_minimum_required(VERSION 3.4.1)
5 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -fvisibility=hidden -w")
7 # Root path into client
8 set(PM3_ROOT ../../)
10 add_subdirectory(../deps deps)
12 # Build zlib deps at external
13 if (CMAKE_MAKE_PROGRAM MATCHES ".*ninja.*")
14     set(BZIP2_INCLUDE_DIRS ${BZIP2_ROOT})
15     set(BZIP2_LIBRARIES pm3rrg_rdv4_bzip2)
16 elseif (UNIX) # Cross compile at Unix Makefile System.
17     # bzip2 dep.
18     include(ExternalProject)
19     set(CFLAGS_EXTERNAL_LIB "CFLAGS=--target=${CMAKE_C_COMPILER_TARGET} -w")
20     set(BZIP2_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/deps/bzip2/src/bzip2)
21     ExternalProject_Add(bzip2
22             GIT_REPOSITORY https://android.googlesource.com/platform/external/bzip2
23             GIT_TAG platform-tools-30.0.2
24             PREFIX deps/bzip2
25             #SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/deps/bzip2
26             CONFIGURE_COMMAND mkdir -p ${BZIP2_BUILD_DIR} && git archive --format tar HEAD | tar -C ${BZIP2_BUILD_DIR} -x
27             BUILD_IN_SOURCE ON
28             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
29             INSTALL_COMMAND ""
30             LOG_DOWNLOAD ON
31             )
32     ExternalProject_Add_StepTargets(bzip2 configure build install)
33     set(BZIP2_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/deps/bzip2/src/bzip2)
34     set(BZIP2_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/deps/bzip2/src/bzip2/libbz2.a)
35 else ()
36     message(ERROR "Please implement your BZIP2 import.")
37 endif ()
39 # client resources
40 add_library(pm3rrg_rdv4 SHARED
41         ${PM3_ROOT}/common/commonutil.c
42         ${PM3_ROOT}/common/util_posix.c
43         ${PM3_ROOT}/common/parity.c
44         ${PM3_ROOT}/common/bucketsort.c
45         ${PM3_ROOT}/common/crapto1/crapto1.c
46         ${PM3_ROOT}/common/crapto1/crypto1.c
47         ${PM3_ROOT}/common/crc.c
48         ${PM3_ROOT}/common/crc16.c
49         ${PM3_ROOT}/common/crc32.c
50         ${PM3_ROOT}/common/crc64.c
51         ${PM3_ROOT}/common/lfdemod.c
52         ${PM3_ROOT}/common/legic_prng.c
53         ${PM3_ROOT}/common/iso15693tools.c
54         ${PM3_ROOT}/common/cardhelper.c
55         ${PM3_ROOT}/common/generator.c
56         ${PM3_ROOT}/client/src/crypto/asn1dump.c
57         ${PM3_ROOT}/client/src/crypto/asn1utils.c
58         ${PM3_ROOT}/client/src/crypto/libpcrypto.c
59         ${PM3_ROOT}/client/src/emv/test/cda_test.c
60         ${PM3_ROOT}/client/src/emv/test/crypto_test.c
61         ${PM3_ROOT}/client/src/emv/test/cryptotest.c
62         ${PM3_ROOT}/client/src/emv/test/dda_test.c
63         ${PM3_ROOT}/client/src/emv/test/sda_test.c
64         ${PM3_ROOT}/client/src/emv/cmdemv.c
65         ${PM3_ROOT}/client/src/emv/crypto.c
66         ${PM3_ROOT}/client/src/emv/crypto_polarssl.c
67         ${PM3_ROOT}/client/src/emv/dol.c
68         ${PM3_ROOT}/client/src/emv/emv_pk.c
69         ${PM3_ROOT}/client/src/emv/emv_pki.c
70         ${PM3_ROOT}/client/src/emv/emv_pki_priv.c
71         ${PM3_ROOT}/client/src/emv/emv_roca.c
72         ${PM3_ROOT}/client/src/emv/emv_tags.c
73         ${PM3_ROOT}/client/src/emv/emvcore.c
74         ${PM3_ROOT}/client/src/emv/emvjson.c
75         ${PM3_ROOT}/client/src/emv/tlv.c
76         ${PM3_ROOT}/client/src/fido/additional_ca.c
77         ${PM3_ROOT}/client/src/fido/cbortools.c
78         ${PM3_ROOT}/client/src/fido/cose.c
79         ${PM3_ROOT}/client/src/fido/fidocore.c
80         ${PM3_ROOT}/client/src/iso7816/apduinfo.c
81         ${PM3_ROOT}/client/src/iso7816/iso7816core.c
82         ${PM3_ROOT}/client/src/loclass/cipher.c
83         ${PM3_ROOT}/client/src/loclass/cipherutils.c
84         ${PM3_ROOT}/client/src/loclass/elite_crack.c
85         ${PM3_ROOT}/client/src/loclass/hash1_brute.c
86         ${PM3_ROOT}/client/src/loclass/ikeys.c
87         ${PM3_ROOT}/client/src/mifare/mad.c
88         ${PM3_ROOT}/client/src/mifare/mfkey.c
89         ${PM3_ROOT}/client/src/mifare/mifare4.c
90         ${PM3_ROOT}/client/src/mifare/mifaredefault.c
91         ${PM3_ROOT}/client/src/mifare/mifarehost.c
92         ${PM3_ROOT}/client/src/nfc/ndef.c
93         ${PM3_ROOT}/client/src/mifare/desfire_crypto.c
94         ${PM3_ROOT}/client/src/uart/uart_posix.c
95         ${PM3_ROOT}/client/src/uart/uart_win32.c
96         ${PM3_ROOT}/client/src/ui/overlays.ui
97         ${PM3_ROOT}/client/src/aiddesfire.c
98         ${PM3_ROOT}/client/src/aidsearch.c
99         ${PM3_ROOT}/client/src/cmdanalyse.c
100         ${PM3_ROOT}/client/src/cmdcrc.c
101         ${PM3_ROOT}/client/src/cmddata.c
102         ${PM3_ROOT}/client/src/cmdflashmem.c
103         ${PM3_ROOT}/client/src/cmdflashmemspiffs.c
104         ${PM3_ROOT}/client/src/cmdhf.c
105         ${PM3_ROOT}/client/src/cmdhf14a.c
106         ${PM3_ROOT}/client/src/cmdhf14b.c
107         ${PM3_ROOT}/client/src/cmdhf15.c
108         ${PM3_ROOT}/client/src/cmdhfcryptorf.c
109         ${PM3_ROOT}/client/src/cmdhfemrtd.c
110         ${PM3_ROOT}/client/src/cmdhfepa.c
111         ${PM3_ROOT}/client/src/cmdhffelica.c
112         ${PM3_ROOT}/client/src/cmdhffido.c
113         ${PM3_ROOT}/client/src/cmdhficlass.c
114         ${PM3_ROOT}/client/src/cmdhfjooki.c
115         ${PM3_ROOT}/client/src/cmdhflegic.c
116         ${PM3_ROOT}/client/src/cmdhflist.c
117         ${PM3_ROOT}/client/src/cmdhflto.c
118         ${PM3_ROOT}/client/src/cmdhfmf.c
119         ${PM3_ROOT}/client/src/cmdhfmfdes.c
120         ${PM3_ROOT}/client/src/cmdhfmfhard.c
121         ${PM3_ROOT}/client/src/cmdhfmfp.c
122         ${PM3_ROOT}/client/src/cmdhfmfu.c
123         ${PM3_ROOT}/client/src/cmdhfst.c
124         ${PM3_ROOT}/client/src/cmdhfst25ta.c
125         ${PM3_ROOT}/client/src/cmdhfthinfilm.c
126         ${PM3_ROOT}/client/src/cmdhftopaz.c
127         ${PM3_ROOT}/client/src/cmdhfwaveshare.c
128         ${PM3_ROOT}/client/src/cmdhw.c
129         ${PM3_ROOT}/client/src/cmdlf.c
130         ${PM3_ROOT}/client/src/cmdlfawid.c
131         ${PM3_ROOT}/client/src/cmdlfcotag.c
132         ${PM3_ROOT}/client/src/cmdlfdestron.c
133         ${PM3_ROOT}/client/src/cmdlfem.c
134         ${PM3_ROOT}/client/src/cmdlfem410x.c
135         ${PM3_ROOT}/client/src/cmdlfem4x05.c
136         ${PM3_ROOT}/client/src/cmdlfem4x50.c
137         ${PM3_ROOT}/client/src/cmdlfem4x70.c
138         ${PM3_ROOT}/client/src/cmdlffdxb.c
139         ${PM3_ROOT}/client/src/cmdlfgallagher.c
140         ${PM3_ROOT}/client/src/cmdlfguard.c
141         ${PM3_ROOT}/client/src/cmdlfhid.c
142         ${PM3_ROOT}/client/src/cmdlfhitag.c
143         ${PM3_ROOT}/client/src/cmdlfidteck.c
144         ${PM3_ROOT}/client/src/cmdlfindala.c
145         ${PM3_ROOT}/client/src/cmdlfio.c
146         ${PM3_ROOT}/client/src/cmdlfjablotron.c
147         ${PM3_ROOT}/client/src/cmdlfkeri.c
148         ${PM3_ROOT}/client/src/cmdlfmotorola.c
149         ${PM3_ROOT}/client/src/cmdlfnedap.c
150         ${PM3_ROOT}/client/src/cmdlfnexwatch.c
151         ${PM3_ROOT}/client/src/cmdlfnoralsy.c
152         ${PM3_ROOT}/client/src/cmdlfpac.c
153         ${PM3_ROOT}/client/src/cmdlfparadox.c
154         ${PM3_ROOT}/client/src/cmdlfpcf7931.c
155         ${PM3_ROOT}/client/src/cmdlfpresco.c
156         ${PM3_ROOT}/client/src/cmdlfpyramid.c
157         ${PM3_ROOT}/client/src/cmdlfsecurakey.c
158         ${PM3_ROOT}/client/src/cmdlft55xx.c
159         ${PM3_ROOT}/client/src/cmdlfti.c
160         ${PM3_ROOT}/client/src/cmdlfviking.c
161         ${PM3_ROOT}/client/src/cmdlfvisa2000.c
162         ${PM3_ROOT}/client/src/cmdmain.c
163         ${PM3_ROOT}/client/src/cmdnfc.c
164         ${PM3_ROOT}/client/src/cmdparser.c
165         ${PM3_ROOT}/client/src/cmdscript.c
166         ${PM3_ROOT}/client/src/cmdsmartcard.c
167         ${PM3_ROOT}/client/src/cmdtrace.c
168         ${PM3_ROOT}/client/src/cmdusart.c
169         ${PM3_ROOT}/client/src/cmdwiegand.c
170         ${PM3_ROOT}/client/src/comms.c
171         ${PM3_ROOT}/client/src/fileutils.c
172         ${PM3_ROOT}/client/src/flash.c
173         ${PM3_ROOT}/client/src/graph.c
174         ${PM3_ROOT}/client/src/jansson_path.c
175         ${PM3_ROOT}/client/src/preferences.c
176         ${PM3_ROOT}/client/src/pm3_binlib.c
177         ${PM3_ROOT}/client/src/pm3_bitlib.c
178         ${PM3_ROOT}/client/src/prng.c
179         ${PM3_ROOT}/client/src/scandir.c
180         ${PM3_ROOT}/client/src/scripting.c
181         ${PM3_ROOT}/client/src/tea.c
182         ${PM3_ROOT}/client/src/ui.c
183         ${PM3_ROOT}/client/src/util.c
184         ${PM3_ROOT}/client/src/wiegand_formats.c
185         ${PM3_ROOT}/client/src/wiegand_formatutils.c
186         # android resources
187         jni_tools.c
188         pm3_main.c
189         )
191 # includes
192 target_include_directories(pm3rrg_rdv4 PRIVATE
193         ${CMAKE_CURRENT_SOURCE_DIR}
194         ${BZIP2_INCLUDE_DIRS}
195         ${PM3_ROOT}/include/
196         ${PM3_ROOT}/common
197         ${PM3_ROOT}/common_fpga
198         ${PM3_ROOT}/client/src)
200 target_link_libraries(pm3rrg_rdv4
201         ${BZIP2_LIBRARIES}
202         pm3rrg_rdv4_hardnested
203         pm3rrg_rdv4_mbedtls
204         pm3rrg_rdv4_cliparser
205         pm3rrg_rdv4_jansson
206         pm3rrg_rdv4_lua
207         pm3rrg_rdv4_tinycbor
208         pm3rrg_rdv4_amiibo
209         pm3rrg_rdv4_reveng
210         pm3rrg_rdv4_whereami
211         android
212         log)