From b9104b76cf4013767a667b3dae4801b7bbbf462d Mon Sep 17 00:00:00 2001 From: Ilesh Date: Sun, 7 Nov 2021 12:11:39 +0530 Subject: [PATCH] Improved makefile build commands --- .gitignore | 1 + README.md | 5 +++-- makefile | 21 +++++++++++++++++---- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 0592392..02b69b3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target +/out .DS_Store diff --git a/README.md b/README.md index 4c2ffcc..1fbeeb9 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![rust badge](https://img.shields.io/static/v1?label=Made%20with&message=Rust&style=for-the-badge&logo=rust&labelColor=e82833&color=b11522)](https://www.rust-lang.org/) [![license badge](https://img.shields.io/github/license/theRookieCoder/ferium?style=for-the-badge)](https://github.com/theRookieCoder/ferium/blob/main/LICENSE.txt) [![copyleft badge](https://img.shields.io/static/v1?label=&message=Copyleft&style=for-the-badge&labelColor=silver&color=silver&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAQAAAC0NkA6AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAHdElNRQfjAxYBNgYPa+9oAAAEM0lEQVRYw6WYb0zVVRjHP9wQW7umA0xoKNSC+6bSNkzetKZbaVu19aLpfOGcbcw/S+uNbikuNwMsVyE3XVsro7VEXjS3ylmLxkRtC9crHGjCAv9AATK4CoZye8Hl/J7n/M7v8rvX57w55/lznt/583yf5/xyCEOlrKaSCp6ggCiQYJheLvMHv9HHA1MZ++kmmaZ1UUNZ9g6eo4X7aR3Mtvs0syJzB0U0MR3KgddOsiQTFxsZzdDBTLvFetd0OT5OHo1U+7j9tNJBN4MkgChFVLCS1Sz1aR7jHf5Lv4Yov1hfN8YRKgP1V9LIuGVxhmg6Fwv4XalPcJD8OTe3gA+YVHYXg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qQgmg/wHquM6d9tIV7AAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxOS0wMy0yMlQwMTo1NDowNiswMDowMOIizoUAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTktMDMtMjJUMDE6NTQ6MDYrMDA6MDCTf3Y5AAAAAElFTkSuQmCC)](https://en.wikipedia.org/wiki/Copyleft) -Ferium is an open source and easy to use package manager for Minecraft mods on [Modrinth](https://modrinth.com) and [GitHub Releases](https://github.com/releases). Simply specify the mods you use through the CLI and in just one command, you can download all the mods and update any existing ones. +Ferium is an open source and easy to use package manager for Minecraft mods on [Modrinth](https://modrinth.com) and [GitHub Releases](https://github.com/releases). Simply specify the mods you use through the CLI and in just one command, you can download all the mods and update existing ones. ## Feature requests @@ -10,4 +10,5 @@ If you want to have a feature added, check the [project](https://github.com/theR ## Building or working on Ferium -You can build the project and install it to `~/bin` make sure you have `cargo` installed and run `make install`. If you are working on the project, you can use `make install-dev`. If you want to obtain executables for a specific OS, you can run `make build-` and replace `` with `mac`, `win`, or `linux` +First you have to install the Rust toolchain (`cargo`, `rustup`, etc). +To build the project and install it to `~/bin`, run `make install`. If you want to test the project, you can use `make install-dev` which compiles with `--debug`. If you want to obtain executables for a specific OS, you can run `make build-` and replace `` with `mac`, `win`, or `linux`. The produced binaries will be zipped and moved to `out/` diff --git a/makefile b/makefile index da95c7f..97ca9e2 100644 --- a/makefile +++ b/makefile @@ -1,20 +1,33 @@ build-mac: cargo clean - # For macOS on Intel + rm -f out/ferium-macos-x64.zip out/ferium-macos-arm.zip + mkdir -p out + cargo build --target=x86_64-apple-darwin --release - # For macOS on Apple Silicon cargo build --target=aarch64-apple-darwin --release + zip -r out/ferium-macos-x64.zip -j target/x86_64-apple-darwin/release/ferium + zip -r out/ferium-macos-arm.zip -j target/aarch64-apple-darwin/release/ferium + build-win: cargo clean - # For Windows x64 + rm -f out/ferium-windows-gnu.zip + mkdir -p out + cargo build --target=x86_64-pc-windows-gnu --release + zip -r out/ferium-windows-gnu.zip -j target/x86_64-pc-windows-gnu/release/ferium + build-linux: cargo clean - # For Linux x86-64 + rm -f out/ferium-linux-gnu.zip + mkdir -p out + cargo build --target=x86_64-unknown-linux-gnu --release + mkdir out + zip -r out/ferium-linux-gnu.zip -j target/x86_64-unknown-linux-gnu/release/ferium + install: cargo install --force --path . --root ~