add otool binary

This commit is contained in:
Gregory 2019-08-10 15:56:14 +03:00
parent 064cf9ca85
commit a748fe4da4
4 changed files with 28 additions and 9 deletions

1
.gitignore vendored
View file

@ -9,3 +9,4 @@
/debug_bld /debug_bld
/out /out
/ft_nm /ft_nm
/ft_otool

View file

@ -5,13 +5,15 @@ OUT_DIR="$PWD/out"
RELEASE_BLD_DIR="$PWD/bld" RELEASE_BLD_DIR="$PWD/bld"
DEBUG_BLD_DIR="$PWD/debug_bld" DEBUG_BLD_DIR="$PWD/debug_bld"
TARGET="ft_nm" FT_NM="ft_nm"
FT_OTOOL="ft_otool"
meson $RELEASE_BLD_DIR --prefix=$OUT_DIR --libdir=$OUT_DIR --includedir=$OUT_DIR --buildtype=release meson $RELEASE_BLD_DIR --prefix=$OUT_DIR --libdir=$OUT_DIR --includedir=$OUT_DIR --bindir=$OUT_DIR --buildtype=release
meson $DEBUG_BLD_DIR --buildtype=debug meson $DEBUG_BLD_DIR --buildtype=debug
ninja -C $DEBUG_BLD_DIR ninja -C $DEBUG_BLD_DIR
ninja -C $RELEASE_BLD_DIR ninja -C $RELEASE_BLD_DIR
ninja -C $RELEASE_BLD_DIR install ninja -C $RELEASE_BLD_DIR install
ln -sf "$OUT_DIR/bin/$TARGET" "$PWD/$TARGET" ln -sf "$OUT_DIR//$FT_NM" "$PWD/$FT_NM"
ln -sf "$OUT_DIR/$FT_OTOOL" "$PWD/$FT_OTOOL"

View file

@ -25,9 +25,9 @@ add_global_arguments(
inc = include_directories('inc') inc = include_directories('inc')
install_headers('inc/ft_nm.h') # install_headers('inc/ft_nm.h')
sources = [ nm_sources = [
'src/nm/main.c', 'src/nm/main.c',
'src/nm/nm_file.c', 'src/nm/nm_file.c',
'src/nm/macho64.c', 'src/nm/macho64.c',
@ -38,14 +38,23 @@ sources = [
'src/nm/find_symbol_table_command.c', 'src/nm/find_symbol_table_command.c',
] ]
libft = subproject('libft') otool_sources = [
'src/otool/main.c'
libft_dep = libft.get_variable('libft_dep') ]
libft_dep = subproject('libft').get_variable('libft_dep')
ft_nm = executable( ft_nm = executable(
'ft_nm', 'ft_nm',
sources, nm_sources,
include_directories: inc,
dependencies: libft_dep,
install: true,
)
ft_nm = executable(
'ft_otool',
otool_sources,
include_directories: inc, include_directories: inc,
dependencies: libft_dep, dependencies: libft_dep,
install: true, install: true,

7
src/otool/main.c Normal file
View file

@ -0,0 +1,7 @@
#include "libft.h"
int main()
{
ft_putstr("hello from otool!");
return (0);
}