From 1df33249c41092d653bf5edef9abb301b3c4d82c Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Tue, 4 Apr 2023 00:36:40 +0200 Subject: [PATCH] Add Makefile for easier building --- .github/workflows/master-build.yml | 4 ++-- .github/workflows/release-build.yml | 2 +- Makefile | 24 ++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 Makefile diff --git a/.github/workflows/master-build.yml b/.github/workflows/master-build.yml index 7db1fe0..32ef5d5 100644 --- a/.github/workflows/master-build.yml +++ b/.github/workflows/master-build.yml @@ -27,7 +27,7 @@ jobs: restore-keys: | ${{ runner.os }}-${{ env.cache-name }}- - name: Build - run: cargo build --verbose + run: make debug - name: Run tests run: cargo test --verbose -p schemsearch-lib @@ -46,7 +46,7 @@ jobs: restore-keys: | ${{ runner.os }}-${{ env.cache-name }}- - name: Build - run: cargo build --verbose --release -p schemsearch-cli + run: make - name: Upload a Build Artifact uses: actions/upload-artifact@v3.1.2 with: diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 0a48337..301b087 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -30,7 +30,7 @@ jobs: restore-keys: | ${{ runner.os }}-${{ env.cache-name }}- - name: Build - run: cargo build --verbose --release -p schemsearch-cli + run: make - name: Create Tarball if: ${{ matrix.os != 'windows-latest' }} run: tar -czvf schemsearch-cli-${{ matrix.os }}.tar.gz -C target/release schemsearch-cli diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9f26d3a --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +default: + @echo "Building (Release)..."; + cargo rustc --release --color=always -p schemsearch-cli -- -C target-feature=+avx2 + +debug: + @echo "Building (Debug)..."; + cargo build -p schemsearch-cli + +install: default + @echo "Installing..."; + install -Dm755 target/release/schemsearch-cli /usr/bin/schemsearch + +uninstall: + @echo "Uninstalling..."; + rm -f /usr/bin/schemsearch + +java: + @echo "Building Java..."; + @echo "WARNING: This is WORK IN PROGRESS!"; + javac SchemSearch.java + +clean: + @echo "Cleaning..."; + cargo clean \ No newline at end of file