Skip to content

Commit

Permalink
makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
sauroter committed Jul 5, 2018
1 parent 0cff7ff commit 245bdaf
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bin
.vscode
36 changes: 36 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BIN=bin
BINARY_NAME=$(BIN)/moodle-fetcher
BINARY_UNIX=$(BINARY_NAME)_unix
BINARY_WINDOWS=$(BINARY_NAME)_windows
BINARY_DARWIN=$(BINARY_NAME)_darwin
PACKAGE=$(BINARY_NAME).tar.gz


all: test build
build:
$(GOBUILD) -o $(BINARY_NAME) -v
clean:
$(GOCLEAN)
rm -rf $(BIN)
run:
$(GOBUILD) -o $(BINARY_NAME) -v ./...
./$(BINARY_NAME)

# Cross compilation
build-linux:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINARY_UNIX) -v
build-windows:
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 $(GOBUILD) -o $(BINARY_WINDOWS) -v
build-darwin:
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 $(GOBUILD) -o $(BINARY_DARWIN) -v
package:
tar -czf $(PACKAGE) *

release: build-linux build-windows build-darwin package

19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
A small command line tool to download ressources, like pdfs or images, from moodle.
A small command line tool for downloading resources, like pdfs or images, from Moodle.

Install:
Build:
```
$ go get github.com/s-gheldd/moodle-fetcher
$ go get github.com/s-gheldd/moodle-fetcher
```
(or clone and go install)
```
$ git clone github.com/s-gheldd/moodle-fetcher.git
$ go install
```
(or clone and make)
```
$ git clone github.com/s-gheldd/moodle-fetcher.git
$ make
```
Install:
Download release for your OS.

Usage:
```
$ moodle-fetcher -u <url> [-p <password>] -n <username>
```
```

0 comments on commit 245bdaf

Please sign in to comment.