From 5f4385986cccecd90f56102d3cacf7b1f8f634b1 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sun, 19 Apr 2020 10:56:16 +0200 Subject: [PATCH] cleaning makefile & cmake --- client/CMakeLists.txt | 6 ++---- client/Makefile | 10 +++++----- client/deps/hardnested.cmake | 1 + client/deps/reveng.cmake | 1 + client/src/cmdcrc.c | 2 +- client/src/cmddata.c | 2 +- client/src/cmdhf.c | 2 +- client/src/cmdhf14a.c | 2 +- client/src/cmdhffido.c | 2 +- client/src/cmdhfmf.c | 4 ++-- client/src/cmdhfmfdes.c | 2 +- client/src/cmdhfmfhard.c | 6 +++--- client/src/cmdhfmfp.c | 2 +- client/src/cmdhfmfu.c | 2 +- client/src/cmdlfindala.c | 2 +- client/src/cmdlfmotorola.c | 2 +- client/src/emv/cmdemv.c | 2 +- 17 files changed, 25 insertions(+), 25 deletions(-) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index df51b4f14..66e3a729b 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -80,7 +80,6 @@ set (TARGET_SOURCES ../common/generator.c deps/cliparser/argtable3.c deps/cliparser/cliparser.c - deps/hardnested/hardnested_bruteforce.c src/crypto/asn1dump.c src/crypto/asn1utils.c src/crypto/libpcrypto.c @@ -246,7 +245,7 @@ target_include_directories(proxmark3 PRIVATE .. ../common ../include - deps + deps/cliparser src src/uart ) @@ -265,8 +264,7 @@ find_library(reveng REQUIRED) find_library(z REQUIRED) find_library(hardnested REQUIRED) -target_include_directories(proxmark3 PUBLIC mbedtls jansson lua tinycbor amiibo reveng z hardnested) -target_link_libraries(proxmark3 readline pthread m mbedtls jansson lua tinycbor amiibo reveng z hardnested ${ADDITIONAL_LNK}) +target_link_libraries(proxmark3 PRIVATE readline pthread m mbedtls jansson lua tinycbor amiibo reveng z hardnested ${ADDITIONAL_LNK}) install(TARGETS proxmark3 DESTINATION "bin") install(DIRECTORY cmdscripts lualibs luascripts resources dictionaries DESTINATION "share/proxmark3") diff --git a/client/Makefile b/client/Makefile index fa9dd281f..41b36f9ee 100644 --- a/client/Makefile +++ b/client/Makefile @@ -17,7 +17,7 @@ include ../Makefile.defs INSTALLBIN = proxmark3 INSTALLSHARE = cmdscripts lualibs luascripts resources dictionaries -VPATH = ../common src/uart src deps +VPATH = ../common src/uart src vpath %.dic dictionaries OBJDIR = obj @@ -52,7 +52,7 @@ ZLIBPATH = ../common/zlib ZLIB = $(OBJDIR)/libz.a LIBS = -I$(LUALIBPATH) -I$(MBEDTLSLIBPATH) -I$(JANSSONLIBPATH) -I$(CBORLIBPATH) -I$(ZLIBPATH) -I$(REVENGPATH) -I$(AMIIBOLIBPATH) -I$(HARDNESTEDPATH) -INCLUDES_CLIENT = -I./src -I./deps -I../include -I../common -I./deps/cliparser -I./src/uart $(LIBS) +INCLUDES_CLIENT = -I./src -I../include -I../common -I./deps/cliparser -I./src/uart $(LIBS) CFLAGS ?= -Wall -Werror -O3 # We cannot just use CFLAGS+=... because it has impact on sub-makes if CFLAGS is defined in env: PM3CFLAGS = $(CFLAGS) -std=c99 -D_ISOC99_SOURCE $(INCLUDES_CLIENT) @@ -63,7 +63,7 @@ ifneq (,$(findstring MINGW,$(platform))) PM3CFLAGS += -mno-ms-bitfields -fexec-charset=cp850 endif CXXFLAGS ?= -Wall -Werror -O3 -PM3CXXFLAGS = $(CXXFLAGS) -I../include -I/.deps/cliparser +PM3CXXFLAGS = $(CXXFLAGS) -I../include LUAPLATFORM = generic ifneq (,$(findstring MINGW,$(platform))) @@ -150,8 +150,8 @@ CMDSRCS = crapto1/crapto1.c \ crypto/asn1dump.c \ crypto/libpcrypto.c\ crypto/asn1utils.c\ - cliparser/argtable3.c\ - cliparser/cliparser.c\ + deps/cliparser/argtable3.c\ + deps/cliparser/cliparser.c\ loclass/cipher.c \ loclass/cipherutils.c \ loclass/ikeys.c \ diff --git a/client/deps/hardnested.cmake b/client/deps/hardnested.cmake index facb804fa..6559f4faa 100644 --- a/client/deps/hardnested.cmake +++ b/client/deps/hardnested.cmake @@ -105,3 +105,4 @@ target_include_directories(hardnested PRIVATE ../../include ../src jansson) +target_include_directories(hardnested INTERFACE hardnested) diff --git a/client/deps/reveng.cmake b/client/deps/reveng.cmake index 80fd2930b..cae29dd54 100644 --- a/client/deps/reveng.cmake +++ b/client/deps/reveng.cmake @@ -12,4 +12,5 @@ add_library(reveng STATIC target_compile_definitions(reveng PRIVATE PRESETS) target_include_directories(reveng PRIVATE .) +target_include_directories(reveng INTERFACE reveng) target_compile_options(reveng PRIVATE -Wall -Werror -O3) diff --git a/client/src/cmdcrc.c b/client/src/cmdcrc.c index d51e18021..8830f5530 100644 --- a/client/src/cmdcrc.c +++ b/client/src/cmdcrc.c @@ -22,7 +22,7 @@ # endif /* STDIN_FILENO */ #endif /* _WIN32 */ -#include "reveng/reveng.h" +#include "reveng.h" #include "ui.h" #include "util.h" diff --git a/client/src/cmddata.c b/client/src/cmddata.c index 86cc91dfd..ce8190ace 100644 --- a/client/src/cmddata.c +++ b/client/src/cmddata.c @@ -25,7 +25,7 @@ #include "cmdlfem4x.h" // askem410xdecode #include "fileutils.h" // searchFile #include "mifare/ndef.h" -#include "cliparser/cliparser.h" +#include "cliparser.h" uint8_t DemodBuffer[MAX_DEMOD_BUF_LEN]; size_t DemodBufferLen = 0; diff --git a/client/src/cmdhf.c b/client/src/cmdhf.c index 9ea34420a..b8688512b 100644 --- a/client/src/cmdhf.c +++ b/client/src/cmdhf.c @@ -16,7 +16,7 @@ #include // tolower #include "cmdparser.h" // command_t -#include "cliparser/cliparser.h" // parse +#include "cliparser.h" // parse #include "comms.h" // clearCommandBuffer #include "lfdemod.h" // computeSignalProperties #include "cmdhf14a.h" // ISO14443-A diff --git a/client/src/cmdhf14a.c b/client/src/cmdhf14a.c index 029b354d2..50af60cfc 100644 --- a/client/src/cmdhf14a.c +++ b/client/src/cmdhf14a.c @@ -19,7 +19,7 @@ #include "commonutil.h" // ARRAYLEN #include "comms.h" // clearCommandBuffer #include "cmdtrace.h" -#include "cliparser/cliparser.h" +#include "cliparser.h" #include "cmdhfmf.h" #include "cmdhfmfu.h" #include "emv/emvcore.h" diff --git a/client/src/cmdhffido.c b/client/src/cmdhffido.c index e6f89790a..9bb5bf604 100644 --- a/client/src/cmdhffido.c +++ b/client/src/cmdhffido.c @@ -30,7 +30,7 @@ #include "proxmark3.h" #include "emv/emvcore.h" #include "emv/emvjson.h" -#include "cliparser/cliparser.h" +#include "cliparser.h" #include "../crypto/asn1utils.h" #include "../crypto/libpcrypto.h" #include "fido/cbortools.h" diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index 44e56351b..d6ce07592 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -19,8 +19,8 @@ #include "cmdtrace.h" #include "emv/dump.h" #include "mifare/mifaredefault.h" // mifare default key array -#include "cliparser/cliparser.h" // argtable -#include "hardnested/hardnested_bf_core.h" // SetSIMDInstr +#include "cliparser.h" // argtable +#include "hardnested_bf_core.h" // SetSIMDInstr #include "mifare/mad.h" #include "mifare/ndef.h" #include "protocols.h" diff --git a/client/src/cmdhfmfdes.c b/client/src/cmdhfmfdes.c index d02c1ddfa..101e1d9d9 100644 --- a/client/src/cmdhfmfdes.c +++ b/client/src/cmdhfmfdes.c @@ -24,7 +24,7 @@ #include "protocols.h" #include "mifare.h" // desfire raw command options #include "cmdtrace.h" -#include "cliparser/cliparser.h" +#include "cliparser.h" #include "emv/apduinfo.h" // APDU manipulation / errorcodes #include "emv/emvcore.h" // APDU logging #include "util_posix.h" // msleep diff --git a/client/src/cmdhfmfhard.c b/client/src/cmdhfmfhard.c index 85e91ac64..2cc7f22e8 100644 --- a/client/src/cmdhfmfhard.c +++ b/client/src/cmdhfmfhard.c @@ -32,9 +32,9 @@ #include "util_posix.h" #include "crapto1/crapto1.h" #include "parity.h" -#include "hardnested/hardnested_bruteforce.h" -#include "hardnested/hardnested_bf_core.h" -#include "hardnested/hardnested_bitarray_core.h" +#include "hardnested_bruteforce.h" +#include "hardnested_bf_core.h" +#include "hardnested_bitarray_core.h" #include "zlib.h" #include "fileutils.h" diff --git a/client/src/cmdhfmfp.c b/client/src/cmdhfmfp.c index 91418b191..c007345e7 100644 --- a/client/src/cmdhfmfp.c +++ b/client/src/cmdhfmfp.c @@ -19,7 +19,7 @@ #include "mifare/mifare4.h" #include "mifare/mad.h" #include "mifare/ndef.h" -#include "cliparser/cliparser.h" +#include "cliparser.h" #include "emv/dump.h" #include "mifare/mifaredefault.h" #include "util_posix.h" diff --git a/client/src/cmdhfmfu.c b/client/src/cmdhfmfu.c index 22ae51f1c..425ab435f 100644 --- a/client/src/cmdhfmfu.c +++ b/client/src/cmdhfmfu.c @@ -20,7 +20,7 @@ #include "protocols.h" #include "generator.h" #include "mifare/ndef.h" -#include "cliparser/cliparser.h" +#include "cliparser.h" #define MAX_UL_BLOCKS 0x0F diff --git a/client/src/cmdlfindala.c b/client/src/cmdlfindala.c index e5651a3ad..83d952ea6 100644 --- a/client/src/cmdlfindala.c +++ b/client/src/cmdlfindala.c @@ -19,7 +19,7 @@ #include "cmdparser.h" // command_t #include "comms.h" #include "graph.h" -#include "cliparser/cliparser.h" +#include "cliparser.h" #include "commonutil.h" #include "ui.h" // PrintAndLog #include "lfdemod.h" // parityTest, bitbytes_to_byte diff --git a/client/src/cmdlfmotorola.c b/client/src/cmdlfmotorola.c index 66427a49a..b6ba5b8b0 100644 --- a/client/src/cmdlfmotorola.c +++ b/client/src/cmdlfmotorola.c @@ -23,7 +23,7 @@ #include "protocols.h" // t55xx defines #include "cmdlft55xx.h" // clone.. #include "cmdlf.h" // cmdlfconfig -#include "cliparser/cliparser.h" // cli parse input +#include "cliparser.h" // cli parse input static int CmdHelp(const char *Cmd); diff --git a/client/src/emv/cmdemv.c b/client/src/emv/cmdemv.c index baef18d04..2cf76a636 100644 --- a/client/src/emv/cmdemv.c +++ b/client/src/emv/cmdemv.c @@ -17,7 +17,7 @@ #include "cmdtrace.h" #include "emvjson.h" #include "test/cryptotest.h" -#include "cliparser/cliparser.h" +#include "cliparser.h" #include "cmdparser.h" #include "proxmark3.h" #include "emv_roca.h"