From 2c54547ec080f9e4182d853288be6b414bc9611a Mon Sep 17 00:00:00 2001 From: Riccardo Schirone Date: Fri, 22 Jan 2021 20:05:18 +0100 Subject: [PATCH] Clean dependencies between modules and put them in order --- binrz/rz-asm/meson.build | 6 ---- binrz/rz-bin/meson.build | 9 ------ binrz/rz-hash/meson.build | 5 ---- librz/analysis/meson.build | 4 +-- librz/analysis/p/analysis_avr.c | 2 +- librz/asm/meson.build | 8 ++--- librz/bin/meson.build | 9 +++--- librz/core/meson.build | 34 ++++++++++----------- librz/crypto/meson.build | 2 +- librz/debug/meson.build | 18 ++++------- librz/debug/p/debug_bf.c | 1 - librz/debug/p/debug_bochs.c | 1 - librz/debug/p/debug_esil.c | 1 - librz/debug/p/debug_gdb.c | 1 - librz/debug/p/debug_io.c | 1 - librz/debug/p/debug_native.c | 1 - librz/debug/p/debug_qnx.c | 1 - librz/debug/p/debug_rap.c | 1 - librz/debug/p/debug_winkd.c | 1 - librz/debug/p/native/linux/linux_debug.c | 1 - librz/debug/p/native/xnu/xnu_debug.c | 1 - librz/egg/meson.build | 9 ++---- librz/io/meson.build | 8 ++--- librz/main/meson.build | 38 +++++++++++------------- librz/parse/meson.build | 2 +- librz/syscall/meson.build | 4 +-- shlr/meson.build | 4 +-- 27 files changed, 60 insertions(+), 113 deletions(-) diff --git a/binrz/rz-asm/meson.build b/binrz/rz-asm/meson.build index 3f9ec133af..b2d746d4b3 100644 --- a/binrz/rz-asm/meson.build +++ b/binrz/rz-asm/meson.build @@ -2,12 +2,6 @@ executable('rz-asm', 'rz-asm.c', include_directories: [platform_inc], dependencies: [ rz_main_dep, - rz_util_dep, - rz_asm_dep, - rz_analysis_dep, - rz_crypto_dep, - rz_syscall_dep, - rz_hash_dep ], install: true, install_rpath: rpath_exe, diff --git a/binrz/rz-bin/meson.build b/binrz/rz-bin/meson.build index e48685b4d3..d8531636b1 100644 --- a/binrz/rz-bin/meson.build +++ b/binrz/rz-bin/meson.build @@ -1,16 +1,7 @@ executable('rz-bin', 'rz-bin.c', include_directories: [platform_inc], dependencies: [ - rz_util_dep, - rz_cons_dep, rz_main_dep, - rz_config_dep, - rz_hash_dep, - rz_io_dep, - rz_crypto_dep, - rz_core_dep, - rz_magic_dep, - rz_bin_dep ], install: true, install_rpath: rpath_exe, diff --git a/binrz/rz-hash/meson.build b/binrz/rz-hash/meson.build index a22fb0a078..877f11e8f5 100644 --- a/binrz/rz-hash/meson.build +++ b/binrz/rz-hash/meson.build @@ -1,12 +1,7 @@ executable('rz-hash', 'rz-hash.c', include_directories: [platform_inc], dependencies: [ - rz_util_dep, rz_main_dep, - rz_hash_dep, - rz_io_dep, - rz_crypto_dep, - rz_socket_dep ], install: true, install_rpath: rpath_exe, diff --git a/librz/analysis/meson.build b/librz/analysis/meson.build index 1ed1841940..050d6dad43 100644 --- a/librz/analysis/meson.build +++ b/librz/analysis/meson.build @@ -173,13 +173,13 @@ rz_analysis = library('rz_analysis', rz_analysis_sources, c_args: library_cflags, dependencies: [ rz_util_dep, + rz_crypto_dep, rz_reg_dep, rz_syscall_dep, rz_search_dep, rz_cons_dep, rz_flag_dep, rz_hash_dep, - rz_crypto_dep, rz_parse_dep, rz_asm_dep, java_dep, @@ -202,9 +202,9 @@ pkgconfig_mod.generate(rz_analysis, libraries: pkgcfg_sanitize_libs, requires: [ 'rz_util', + 'rz_crypto', 'rz_reg', 'rz_asm', - 'rz_crypto', 'rz_parse', 'rz_syscall', 'rz_search', diff --git a/librz/analysis/p/analysis_avr.c b/librz/analysis/p/analysis_avr.c index 86f335275a..a441fd3471 100644 --- a/librz/analysis/p/analysis_avr.c +++ b/librz/analysis/p/analysis_avr.c @@ -6,9 +6,9 @@ https://en.wikipedia.org/wiki/Atmel_AVR_instruction_set #endif #include +#include #include #include -#include #include #include #include diff --git a/librz/asm/meson.build b/librz/asm/meson.build index 8233356f97..1518110c4b 100644 --- a/librz/asm/meson.build +++ b/librz/asm/meson.build @@ -220,13 +220,10 @@ rz_asm = library('rz_asm', rz_asm_sources, include_directories: rz_asm_inc, c_args: library_cflags, dependencies: [ - rz_syscall_dep, - rz_lang_dep, rz_util_dep, - rz_parse_dep, + rz_syscall_dep, rz_flag_dep, - rz_cons_dep, - rz_reg_dep, + rz_parse_dep, capstone_dep, java_dep ], @@ -249,7 +246,6 @@ pkgconfig_mod.generate(rz_asm, 'rz_util', 'rz_syscall', 'rz_parse', - 'rz_lang', 'rz_flag', 'rz_socket' ], diff --git a/librz/bin/meson.build b/librz/bin/meson.build index 05819740a2..4f2aace225 100644 --- a/librz/bin/meson.build +++ b/librz/bin/meson.build @@ -141,17 +141,16 @@ rz_bin = library('rz_bin', rz_bin_sources, include_directories: rz_bin_inc, c_args: ['-DRZ_API_BIN_ONLY=1'] + library_cflags, dependencies: [ + java_dep, + lz4_dep, + yxml_dep, rz_util_dep, - rz_io_dep, rz_socket_dep, rz_magic_dep, rz_hash_dep, rz_syscall_dep, rz_cons_dep, - rz_crypto_dep, - java_dep, - lz4_dep, - yxml_dep + rz_io_dep, ], install: true, implicit_include_directories: false, diff --git a/librz/core/meson.build b/librz/core/meson.build index 6cd165d537..7fcbaa9102 100644 --- a/librz/core/meson.build +++ b/librz/core/meson.build @@ -93,26 +93,26 @@ endif rz_core_inc = [platform_inc, include_directories(rz_core_inc)] rz_core_deps = [ - rz_config_dep, - rz_cons_dep, - rz_io_dep, rz_util_dep, - rz_flag_dep, - rz_asm_dep, - rz_debug_dep, - rz_hash_dep, - rz_bin_dep, - rz_lang_dep, - rz_analysis_dep, - rz_parse_dep, - rz_bp_dep, - rz_egg_dep, - rz_reg_dep, - rz_search_dep, - rz_syscall_dep, - rz_socket_dep, rz_magic_dep, + rz_socket_dep, + rz_flag_dep, + rz_cons_dep, + rz_lang_dep, + rz_hash_dep, rz_crypto_dep, + rz_io_dep, + rz_reg_dep, + rz_bp_dep, + rz_syscall_dep, + rz_parse_dep, + rz_asm_dep, + rz_egg_dep, + rz_search_dep, + rz_analysis_dep, + rz_debug_dep, + rz_config_dep, + rz_bin_dep, platform_deps, gdb_dep, java_dep, diff --git a/librz/crypto/meson.build b/librz/crypto/meson.build index 4e638335d9..7feca0c144 100644 --- a/librz/crypto/meson.build +++ b/librz/crypto/meson.build @@ -23,7 +23,7 @@ rz_crypto_sources = [ rz_crypto = library('rz_crypto', rz_crypto_sources, include_directories: [platform_inc], - dependencies: [rz_hash_dep, rz_util_dep], + dependencies: [rz_util_dep], c_args: library_cflags, install: true, implicit_include_directories: false, diff --git a/librz/debug/meson.build b/librz/debug/meson.build index 05e84402c0..20c6f04161 100644 --- a/librz/debug/meson.build +++ b/librz/debug/meson.build @@ -37,19 +37,15 @@ rz_debug_deps = [ gdb_dep, bochs_dep, winkd_dep, - rz_egg_dep, - rz_analysis_dep, - rz_io_dep, - rz_parse_dep, - rz_crypto_dep, + rz_util_dep, + rz_cons_dep, rz_hash_dep, - rz_socket_dep, + rz_io_dep, rz_reg_dep, rz_bp_dep, rz_syscall_dep, - rz_flag_dep, - rz_cons_dep, - rz_util_dep, + rz_egg_dep, + rz_analysis_dep, ] if host_machine.system() == 'linux' or host_machine.system() == 'android' @@ -124,14 +120,10 @@ pkgconfig_mod.generate(rz_debug, 'rz_reg', 'rz_syscall', 'rz_analysis', - 'rz_flag', 'rz_io', 'rz_bp', - 'rz_search', 'rz_cons', - 'rz_lang', 'rz_egg', - 'rz_socket' ], description: 'rizin foundation libraries' ) diff --git a/librz/debug/p/debug_bf.c b/librz/debug/p/debug_bf.c index b86a07b59c..9df16394f0 100644 --- a/librz/debug/p/debug_bf.c +++ b/librz/debug/p/debug_bf.c @@ -1,6 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-only -#include #include #undef RZ_API #define RZ_API static inline diff --git a/librz/debug/p/debug_bochs.c b/librz/debug/p/debug_bochs.c index 699da1ccc3..c42e39390b 100644 --- a/librz/debug/p/debug_bochs.c +++ b/librz/debug/p/debug_bochs.c @@ -1,6 +1,5 @@ /* debugbochs - LGPL - Copyright 2016 - SkUaTeR */ -#include #include #include diff --git a/librz/debug/p/debug_esil.c b/librz/debug/p/debug_esil.c index 9dcd8c4d6f..1af307af60 100644 --- a/librz/debug/p/debug_esil.c +++ b/librz/debug/p/debug_esil.c @@ -1,7 +1,6 @@ // SPDX-License-Identifier: LGPL-3.0-only // r2 -Desil ls -#include #include #if 0 diff --git a/librz/debug/p/debug_gdb.c b/librz/debug/p/debug_gdb.c index 52e5747e4f..439ad83e64 100644 --- a/librz/debug/p/debug_gdb.c +++ b/librz/debug/p/debug_gdb.c @@ -1,7 +1,6 @@ // SPDX-License-Identifier: LGPL-3.0-only #include -#include #include #include #include diff --git a/librz/debug/p/debug_io.c b/librz/debug/p/debug_io.c index a593aa8f0d..e929c19dcf 100644 --- a/librz/debug/p/debug_io.c +++ b/librz/debug/p/debug_io.c @@ -1,7 +1,6 @@ // SPDX-License-Identifier: LGPL-3.0-only #include -#include #include static int __io_step(RzDebug *dbg) { diff --git a/librz/debug/p/debug_native.c b/librz/debug/p/debug_native.c index 7aab20f4bf..caedfd832d 100644 --- a/librz/debug/p/debug_native.c +++ b/librz/debug/p/debug_native.c @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include diff --git a/librz/debug/p/debug_qnx.c b/librz/debug/p/debug_qnx.c index 06f5577de9..81b8d2c472 100644 --- a/librz/debug/p/debug_qnx.c +++ b/librz/debug/p/debug_qnx.c @@ -1,6 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-only -#include #include #include diff --git a/librz/debug/p/debug_rap.c b/librz/debug/p/debug_rap.c index fda7724d18..abcfa7477a 100644 --- a/librz/debug/p/debug_rap.c +++ b/librz/debug/p/debug_rap.c @@ -1,6 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-only -#include #include #include diff --git a/librz/debug/p/debug_winkd.c b/librz/debug/p/debug_winkd.c index 5b00874304..e5c03e3ec6 100644 --- a/librz/debug/p/debug_winkd.c +++ b/librz/debug/p/debug_winkd.c @@ -13,7 +13,6 @@ // You should have received a copy of the GNU Lesser General Public // License along with this library. -#include #include #include #include diff --git a/librz/debug/p/native/linux/linux_debug.c b/librz/debug/p/native/linux/linux_debug.c index 747e49dfca..5422af960b 100644 --- a/librz/debug/p/native/linux/linux_debug.c +++ b/librz/debug/p/native/linux/linux_debug.c @@ -4,7 +4,6 @@ #if DEBUGGER #include -#include #include #include #include diff --git a/librz/debug/p/native/xnu/xnu_debug.c b/librz/debug/p/native/xnu/xnu_debug.c index 33ffc528fc..18cabe48bd 100644 --- a/librz/debug/p/native/xnu/xnu_debug.c +++ b/librz/debug/p/native/xnu/xnu_debug.c @@ -11,7 +11,6 @@ // ------------------------------------ #include -#include #include #include #include diff --git a/librz/egg/meson.build b/librz/egg/meson.build index 361aa13ef8..d17b2ada3d 100644 --- a/librz/egg/meson.build +++ b/librz/egg/meson.build @@ -18,14 +18,9 @@ rz_egg = library('rz_egg', rz_egg_sources, include_directories: [platform_inc], c_args: library_cflags, dependencies: [ - rz_asm_dep, - rz_syscall_dep, rz_util_dep, - rz_parse_dep, - rz_reg_dep, - rz_lang_dep, - rz_flag_dep, - rz_cons_dep, + rz_syscall_dep, + rz_asm_dep, mpc_dep ], install: true, diff --git a/librz/io/meson.build b/librz/io/meson.build index 77ce130323..cc6d894cf3 100644 --- a/librz/io/meson.build +++ b/librz/io/meson.build @@ -58,11 +58,11 @@ rz_io_deps = [ zip_dep, ar_dep, pth, - rz_crypto_dep, - rz_hash_dep, - rz_socket_dep, - rz_cons_dep, # transitive from gdb_dep, but must be explicitly listed here or meson will break the rpath rz_util_dep, + rz_socket_dep, + rz_hash_dep, + rz_crypto_dep, + rz_cons_dep, ] if host_machine.system() == 'windows' diff --git a/librz/main/meson.build b/librz/main/meson.build index bc0cca7712..4bcc67fcc3 100644 --- a/librz/main/meson.build +++ b/librz/main/meson.build @@ -14,28 +14,26 @@ rz_main_sources = [ ] rz_main_deps = [ - rz_config_dep, - rz_cons_dep, - rz_io_dep, rz_util_dep, - rz_flag_dep, - rz_asm_dep, - rz_core_dep, - rz_debug_dep, - rz_hash_dep, - rz_bin_dep, - rz_lang_dep, - rz_io_dep, - rz_analysis_dep, - rz_parse_dep, - rz_bp_dep, - rz_egg_dep, - rz_reg_dep, - rz_search_dep, - rz_syscall_dep, - rz_socket_dep, rz_magic_dep, - rz_crypto_dep + rz_socket_dep, + rz_flag_dep, + rz_cons_dep, + rz_hash_dep, + rz_crypto_dep, + rz_io_dep, + rz_reg_dep, + rz_bp_dep, + rz_syscall_dep, + rz_parse_dep, + rz_asm_dep, + rz_egg_dep, + rz_search_dep, + rz_analysis_dep, + rz_debug_dep, + rz_config_dep, + rz_bin_dep, + rz_core_dep, ] rz_main = library('rz_main', rz_main_sources, diff --git a/librz/parse/meson.build b/librz/parse/meson.build index fe58c4edde..af7b3f09e6 100644 --- a/librz/parse/meson.build +++ b/librz/parse/meson.build @@ -25,8 +25,8 @@ rz_parse = library('rz_parse', rz_parse_sources, include_directories: platform_inc, c_args: library_cflags, dependencies: [ - rz_flag_dep, rz_util_dep, + rz_flag_dep, rz_syscall_dep, rz_reg_dep, rz_cons_dep, diff --git a/librz/syscall/meson.build b/librz/syscall/meson.build index 98b5d9db39..c92426b918 100644 --- a/librz/syscall/meson.build +++ b/librz/syscall/meson.build @@ -6,9 +6,7 @@ rz_syscall_sources = [ rz_syscall = library('rz_syscall', rz_syscall_sources, include_directories: [platform_inc], c_args: library_cflags, - dependencies: [ - rz_util_dep - ], + dependencies: [rz_util_dep], install: true, implicit_include_directories: false, install_rpath: rpath_lib, diff --git a/shlr/meson.build b/shlr/meson.build index bf58dcc5a4..597d33aa73 100644 --- a/shlr/meson.build +++ b/shlr/meson.build @@ -284,7 +284,7 @@ qnx_files = [ qnx_inc = [platform_inc, include_directories('qnx/include')] librzqnx = static_library('rzqnx', qnx_files, - dependencies: [rz_socket_dep, rz_util_dep], + dependencies: [rz_util_dep, rz_socket_dep], include_directories: qnx_inc, implicit_include_directories: false ) @@ -458,7 +458,7 @@ winkd_files = [ winkd_inc = [platform_inc, include_directories('winkd')] librzwinkd = static_library('rzwinkd', winkd_files, - dependencies: [rz_crypto_dep, rz_hash_dep, rz_socket_dep, rz_util_dep], + dependencies: [rz_util_dep, rz_socket_dep, rz_hash_dep, rz_crypto_dep], include_directories: winkd_inc, implicit_include_directories: false )