From d0e8afa45f220dbd0a0abac232da36eede575079 Mon Sep 17 00:00:00 2001 From: Sun Dro Date: Sun, 23 Jul 2023 01:22:08 +0400 Subject: [PATCH] Updated build script --- README.md | 4 ++-- build.sh | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5e6c34b..6380676 100644 --- a/README.md +++ b/README.md @@ -87,10 +87,10 @@ cd libxutils ./build.sh cmake --install --cleanup ``` -You can either choose `cmake` or `smake` as the first argument, but `cmake` is recommended on platforms other than the Linux. +You can either choose `cmake`, `smake` or `make` as the first argument, but `cmake` is recommended on the platforms other than the Linux. #### Using Makefile -If you do not have any of the above tools installed on your operating system, then you can try the build by using already generated `Makefile` for linux. +The project can also be built with a pre-generated `Makefile` for linux. ```bash git clone https://github.com/kala13x/libxutils.git diff --git a/build.sh b/build.sh index 897bea3..f9ce4aa 100755 --- a/build.sh +++ b/build.sh @@ -85,12 +85,22 @@ build_tools() { build_library() { cd $PROJ_PATH - if [[ $MAKE_TOOL == "cmake" ]]; then - mkdir -p build && cd build && cmake .. + if [[ $MAKE_TOOL == "make" ]]; then + make -j $CPU_COUNT + LIB_PATH=$PROJ_PATH + elif [[ $MAKE_TOOL == "smake" ]]; then + smake . && make -j $CPU_COUNT + LIB_PATH=$PROJ_PATH + elif [[ $MAKE_TOOL == "cmake" ]]; then + mkdir -p build && cd build + cmake .. && make -j $CPU_COUNT LIB_PATH=$PROJ_PATH/build + else + echo "Unknown build tool: $MAKE_TOOL" + echo "Specify cmake, smake or make)" + exit 1 fi - make -j $CPU_COUNT cd $PROJ_PATH }