From ad40c4183f4048337b31283c25df6a4b42bb519f Mon Sep 17 00:00:00 2001 From: Christian Deacon Date: Wed, 26 Feb 2025 17:01:51 -0500 Subject: [PATCH] Improve scripts. --- scripts/build.sh | 10 +++++----- scripts/clean.sh | 10 +++++----- scripts/dump_assembly.sh | 7 ------- scripts/install.sh | 10 +++++----- scripts/libxdp_build.sh | 10 +++++----- scripts/libxdp_clean.sh | 10 +++++----- scripts/libxdp_install.sh | 10 +++++----- scripts/objdump.sh | 2 +- 8 files changed, 31 insertions(+), 38 deletions(-) delete mode 100755 scripts/dump_assembly.sh diff --git a/scripts/build.sh b/scripts/build.sh index efbd00c..bd919f1 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -6,8 +6,8 @@ if [ -z "$STATIC" ]; then STATIC=1 fi -if [ -z "$ROOT" ]; then - LIBXDP_STATIC=$STATIC make -else - cd $ROOT && LIBXDP_STATIC=$STATIC make -fi \ No newline at end of file +if [ -n "$ROOT" ]; then + cd $ROOT +fi + +LIBXDP_STATIC=$STATIC make \ No newline at end of file diff --git a/scripts/clean.sh b/scripts/clean.sh index 43c55eb..0c185b3 100755 --- a/scripts/clean.sh +++ b/scripts/clean.sh @@ -1,7 +1,7 @@ #!/bin/bash -if [ -z "$ROOT" ]; then - make clean -else - cd $ROOT && make clean -fi \ No newline at end of file +if [ -n "$ROOT" ]; then + cd $ROOT +fi + +make clean \ No newline at end of file diff --git a/scripts/dump_assembly.sh b/scripts/dump_assembly.sh deleted file mode 100755 index a086693..0000000 --- a/scripts/dump_assembly.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -if [ -n "$ROOT" ]; then - cd $ROOT -fi - -llvm-objdump -S --no-show-raw-insn build/xdp/xdp_prog.o > dump.asm \ No newline at end of file diff --git a/scripts/install.sh b/scripts/install.sh index 3f167e5..dfb81bf 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1,7 +1,7 @@ #!/bin/bash -if [ -z "$ROOT" ]; then - make install -else - cd $ROOT && make install -fi \ No newline at end of file +if [ -n "$ROOT" ]; then + cd $ROOT +fi + +make install \ No newline at end of file diff --git a/scripts/libxdp_build.sh b/scripts/libxdp_build.sh index 1e05d46..0cbae25 100755 --- a/scripts/libxdp_build.sh +++ b/scripts/libxdp_build.sh @@ -1,7 +1,7 @@ #!/bin/bash -if [ -z "$ROOT" ]; then - make libxdp -else - cd $ROOT && make libxdp -fi \ No newline at end of file +if [ -n "$ROOT" ]; then + cd $ROOT +fi + +make libxdp \ No newline at end of file diff --git a/scripts/libxdp_clean.sh b/scripts/libxdp_clean.sh index 7c0a517..d07d36f 100755 --- a/scripts/libxdp_clean.sh +++ b/scripts/libxdp_clean.sh @@ -1,7 +1,7 @@ #!/bin/bash -if [ -z "$ROOT" ]; then - make libxdp_clean -else - cd $ROOT && make libxdp_clean -fi \ No newline at end of file +if [ -n "$ROOT" ]; then + cd $ROOT +fi + +make libxdp_clean \ No newline at end of file diff --git a/scripts/libxdp_install.sh b/scripts/libxdp_install.sh index 56a930f..35c95c1 100755 --- a/scripts/libxdp_install.sh +++ b/scripts/libxdp_install.sh @@ -1,7 +1,7 @@ #!/bin/bash -if [ -z "$ROOT" ]; then - make libxdp_install -else - cd $ROOT && make libxdp_install -fi \ No newline at end of file +if [ -n "$ROOT" ]; then + cd $ROOT +fi + +make libxdp_install \ No newline at end of file diff --git a/scripts/objdump.sh b/scripts/objdump.sh index a086693..10c46a2 100755 --- a/scripts/objdump.sh +++ b/scripts/objdump.sh @@ -4,4 +4,4 @@ if [ -n "$ROOT" ]; then cd $ROOT fi -llvm-objdump -S --no-show-raw-insn build/xdp/xdp_prog.o > dump.asm \ No newline at end of file +llvm-objdump -S --no-show-raw-insn build/xdp/xdp_prog.o > objdump.asm \ No newline at end of file