Skip to content

Commit

Permalink
✨ Merge pull request #2 from Shinyzenith/main ✨
Browse files Browse the repository at this point in the history
Setup build environment with Make.
  • Loading branch information
actualdankcoder authored Jan 17, 2022
2 parents afce4ed + 2f4f0a7 commit f3855fc
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
salmon
27 changes: 27 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
TARGET_DIR := /usr/local/bin
BIN:= salmon

build:
@go mod tidy
@go build

static:
@go mod tidy
@go build -ldflags "-linkmode external -extldflags -static"

install:
@mkdir -p $(TARGET_DIR)
@cp ./$(BIN) $(TARGET_DIR)
@chmod +x $(TARGET_DIR)/$(BIN)

check:
@gofmt -w -s *.go
@go test

uninstall:
@rm $(TARGET_DIR)/$(BIN)

clean:
@go clean

.PHONY: build install check uninstall clean all
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,38 @@
Salmon is a music tracking server that connects with different sources to display a presence
</p>

## Dependencies:
+ `git` - To clone repo (optional).
+ `go` - Required the compile the binary (Required, Make Dependency).
+ `make` - Build system (Optional, Make Dependency).

## Installation

### Windows:
There are two ways to get salmon, you can either head to [releases](https://github.com/actualdankcoder/salmon/releases) and download the latest binary

**or**

Install the [go compiler](https://go.dev/dl/) and then run the following in the project directory
Compile the binary with the following commands:

```bash
git clone https://github.com/actualdankcoder/salmon
cd salmon
go mod tidy
go build
```
Launch the built binary "salmon.exe"
Once the binary is compiled, you can uninstall all dependencies and add salmon.exe to your PATH variable.

## Linux & MacOS:
Install Go and Make with your package manager and then run the following in the project directory:

+ `git clone https://github.com/actualdankcoder/salmon`
+ `cd salmon`
+ `make` for a dynamically linked binary.
+ `make static` for a statically linked binary.
+ `sudo make install`

Note: If you don't know the difference between dynamic & static linking then just use dynamic linker (`make`)

## Usage

Expand Down

0 comments on commit f3855fc

Please sign in to comment.