From ee0ca569f59a8b335683c680ec67b32f86a49aa2 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Tue, 21 Mar 2017 14:07:40 -0400 Subject: [PATCH] Updated C core and cli build and scripts. --- .gitignore | 12 ++--- platform-independent/cli-c/build | 50 +++++++++++-------- platform-independent/cli-c/clean | 2 +- .../cli-c/{ => cli}/mpw-bench.c | 0 .../cli-c/{ => cli}/mpw-cli.c | 0 .../cli-c/{ => cli}/mpw-tests-util.c | 0 .../cli-c/{ => cli}/mpw-tests-util.h | 0 .../cli-c/{ => cli}/mpw-tests.c | 0 platform-independent/cli-c/core | 1 + platform-independent/cli-c/lib | 1 + platform-independent/cli-c/mpw_tests.xml | 1 + 11 files changed, 38 insertions(+), 29 deletions(-) rename platform-independent/cli-c/{ => cli}/mpw-bench.c (100%) rename platform-independent/cli-c/{ => cli}/mpw-cli.c (100%) rename platform-independent/cli-c/{ => cli}/mpw-tests-util.c (100%) rename platform-independent/cli-c/{ => cli}/mpw-tests-util.h (100%) rename platform-independent/cli-c/{ => cli}/mpw-tests.c (100%) create mode 120000 platform-independent/cli-c/core create mode 120000 platform-independent/cli-c/lib create mode 120000 platform-independent/cli-c/mpw_tests.xml diff --git a/.gitignore b/.gitignore index 436842d8..e07669e2 100644 --- a/.gitignore +++ b/.gitignore @@ -37,14 +37,14 @@ target dependency-reduced-pom.xml # C -desktop/cli/c/*.o -desktop/cli/c/mpw-*.tar.gz -desktop/cli/c/mpw -desktop/cli/c/mpw-bench -desktop/cli/c/mpw-tests -desktop/cli/c/VERSION core/c/*.o core/c/lib/*/.unpacked core/c/lib/*/.patched core/c/lib/*/src core/c/lib/include +platform-independent/cli-c/cli/*.o +platform-independent/cli-c/mpw-*.tar.gz +platform-independent/cli-c/mpw +platform-independent/cli-c/mpw-bench +platform-independent/cli-c/mpw-tests +platform-independent/cli-c/VERSION diff --git a/platform-independent/cli-c/build b/platform-independent/cli-c/build index c119e34d..acab03d2 100755 --- a/platform-independent/cli-c/build +++ b/platform-independent/cli-c/build @@ -217,26 +217,28 @@ mpw() { echo echo "Building target: $target..." local CFLAGS=( - # include paths + # library paths -I"lib/include" + # mpw paths + -I"core" -I"cli" ) local LDFLAGS=( # scrypt "lib/scrypt/src/libcperciva/"*/*.o "lib/scrypt/src/lib/crypto/"*.o # library paths - -L"." -L"lib/scrypt/src" + -L"lib/scrypt/src" # link libraries -l"crypto" ) # optional features (( mpw_color )) && CFLAGS+=( -DCOLOR ) LDFLAGS+=( -l"curses" ) - cc "${CFLAGS[@]}" "$@" -c mpw-algorithm.c -o mpw-algorithm.o - cc "${CFLAGS[@]}" "$@" -c mpw-types.c -o mpw-types.o - cc "${CFLAGS[@]}" "$@" -c mpw-util.c -o mpw-util.o - cc "${CFLAGS[@]}" "$@" "mpw-algorithm.o" "mpw-types.o" "mpw-util.o" \ - "${LDFLAGS[@]}" "mpw-cli.c" -o "mpw" + cc "${CFLAGS[@]}" "$@" -c core/mpw-algorithm.c -o core/mpw-algorithm.o + cc "${CFLAGS[@]}" "$@" -c core/mpw-types.c -o core/mpw-types.o + cc "${CFLAGS[@]}" "$@" -c core/mpw-util.c -o core/mpw-util.o + cc "${CFLAGS[@]}" "$@" "core/mpw-algorithm.o" "core/mpw-types.o" "core/mpw-util.o" \ + "${LDFLAGS[@]}" "cli/mpw-cli.c" -o "mpw" echo "done! Now run ./install or use ./mpw" } @@ -249,8 +251,10 @@ mpw-bench() { echo echo "Building target: $target..." local CFLAGS=( - # include paths + # library paths -I"lib/include" + # mpw paths + -I"core" -I"cli" ) local LDFLAGS=( # scrypt @@ -262,17 +266,17 @@ mpw-bench() { "lib/bcrypt/src/wrapper.o" "lib/bcrypt/src/x86.o" # library paths - -L"." -L"lib/scrypt/src" + -L"lib/scrypt/src" -L"lib/bcrypt/src" # link libraries -l"crypto" ) - cc "${CFLAGS[@]}" "$@" -c mpw-algorithm.c -o mpw-algorithm.o - cc "${CFLAGS[@]}" "$@" -c mpw-types.c -o mpw-types.o - cc "${CFLAGS[@]}" "$@" -c mpw-util.c -o mpw-util.o - cc "${CFLAGS[@]}" "$@" "mpw-algorithm.o" "mpw-types.o" "mpw-util.o" \ - "${LDFLAGS[@]}" "mpw-bench.c" -o "mpw-bench" + cc "${CFLAGS[@]}" "$@" -c core/mpw-algorithm.c -o core/mpw-algorithm.o + cc "${CFLAGS[@]}" "$@" -c core/mpw-types.c -o core/mpw-types.o + cc "${CFLAGS[@]}" "$@" -c core/mpw-util.c -o core/mpw-util.o + cc "${CFLAGS[@]}" "$@" "core/mpw-algorithm.o" "core/mpw-types.o" "core/mpw-util.o" \ + "${LDFLAGS[@]}" "cli/mpw-bench.c" -o "mpw-bench" echo "done! Now use ./mpw-bench" } @@ -284,27 +288,29 @@ mpw-tests() { echo echo "Building target: $target..." local CFLAGS=( - # include paths + # library paths -I"lib/include" -I"/usr/include/libxml2" -I"/usr/local/include/libxml2" + # mpw paths + -I"core" -I"cli" ) local LDFLAGS=( # scrypt "lib/scrypt/src/libcperciva/"*/*.o "lib/scrypt/src/lib/crypto/"*.o # library paths - -L"." -L"lib/scrypt/src" + -L"lib/scrypt/src" # link libraries -l"crypto" -l"xml2" ) - cc "${CFLAGS[@]}" "$@" -c mpw-algorithm.c -o mpw-algorithm.o - cc "${CFLAGS[@]}" "$@" -c mpw-types.c -o mpw-types.o - cc "${CFLAGS[@]}" "$@" -c mpw-util.c -o mpw-util.o - cc "${CFLAGS[@]}" "$@" -c mpw-tests-util.c -o mpw-tests-util.o - cc "${CFLAGS[@]}" "$@" "mpw-algorithm.o" "mpw-types.o" "mpw-util.o" "mpw-tests-util.o" \ - "${LDFLAGS[@]}" "mpw-tests.c" -o "mpw-tests" + cc "${CFLAGS[@]}" "$@" -c core/mpw-algorithm.c -o core/mpw-algorithm.o + cc "${CFLAGS[@]}" "$@" -c core/mpw-types.c -o core/mpw-types.o + cc "${CFLAGS[@]}" "$@" -c core/mpw-util.c -o core/mpw-util.o + cc "${CFLAGS[@]}" "$@" -c cli/mpw-tests-util.c -o cli/mpw-tests-util.o + cc "${CFLAGS[@]}" "$@" "core/mpw-algorithm.o" "core/mpw-types.o" "core/mpw-util.o" \ + "${LDFLAGS[@]}" "cli/mpw-tests-util.o" "cli/mpw-tests.c" -o "mpw-tests" echo "done! Now use ./mpw-tests" } diff --git a/platform-independent/cli-c/clean b/platform-independent/cli-c/clean index 8c19bf44..0574fd10 100755 --- a/platform-independent/cli-c/clean +++ b/platform-independent/cli-c/clean @@ -5,4 +5,4 @@ set -e cd "${BASH_SOURCE%/*}" rm -vfr lib/*/{.unpacked,.patched,src} lib/include -rm -vfr *.o *.dSYM mpw mpw-bench mpw-tests +rm -vfr {core,cli}{*.o,*.dSYM} mpw mpw-bench mpw-tests diff --git a/platform-independent/cli-c/mpw-bench.c b/platform-independent/cli-c/cli/mpw-bench.c similarity index 100% rename from platform-independent/cli-c/mpw-bench.c rename to platform-independent/cli-c/cli/mpw-bench.c diff --git a/platform-independent/cli-c/mpw-cli.c b/platform-independent/cli-c/cli/mpw-cli.c similarity index 100% rename from platform-independent/cli-c/mpw-cli.c rename to platform-independent/cli-c/cli/mpw-cli.c diff --git a/platform-independent/cli-c/mpw-tests-util.c b/platform-independent/cli-c/cli/mpw-tests-util.c similarity index 100% rename from platform-independent/cli-c/mpw-tests-util.c rename to platform-independent/cli-c/cli/mpw-tests-util.c diff --git a/platform-independent/cli-c/mpw-tests-util.h b/platform-independent/cli-c/cli/mpw-tests-util.h similarity index 100% rename from platform-independent/cli-c/mpw-tests-util.h rename to platform-independent/cli-c/cli/mpw-tests-util.h diff --git a/platform-independent/cli-c/mpw-tests.c b/platform-independent/cli-c/cli/mpw-tests.c similarity index 100% rename from platform-independent/cli-c/mpw-tests.c rename to platform-independent/cli-c/cli/mpw-tests.c diff --git a/platform-independent/cli-c/core b/platform-independent/cli-c/core new file mode 120000 index 00000000..6f667dc4 --- /dev/null +++ b/platform-independent/cli-c/core @@ -0,0 +1 @@ +../../core/c \ No newline at end of file diff --git a/platform-independent/cli-c/lib b/platform-independent/cli-c/lib new file mode 120000 index 00000000..c2307820 --- /dev/null +++ b/platform-independent/cli-c/lib @@ -0,0 +1 @@ +core/lib \ No newline at end of file diff --git a/platform-independent/cli-c/mpw_tests.xml b/platform-independent/cli-c/mpw_tests.xml new file mode 120000 index 00000000..7a2509be --- /dev/null +++ b/platform-independent/cli-c/mpw_tests.xml @@ -0,0 +1 @@ +../../core/java/tests/src/main/resources/mpw_tests.xml \ No newline at end of file