Multi-target build

Try to customize the MakeFile in order to be able to build an binary for
any target system.
This commit is contained in:
Bertrand Moreau 2020-08-18 17:18:45 +02:00 committed by Zorglube
parent 81cf970d68
commit c1c793988f
2 changed files with 8 additions and 30 deletions

View File

@ -5,10 +5,13 @@
# For info on installing extra versions, see this page:
# https://golang.org/doc/install#extra_versions
# goosList = "android darwin dragonfly freebsd linux nacl netbsd openbsd plan9 solaris windows"
# goarchList = "386 amd64 amd64p32 arm arm64 ppc64 ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32leppc s390 s390x sparc sparc64"
TAGS=
# Windows needs the .exe extension.
ifeq ($(OS),Windows_NT)
ifeq ($(TARGET),windows)
EXT=.exe
endif
@ -19,9 +22,9 @@ all: fmt vet test MovieNight$(EXT) static/main.wasm settings.json
# Build the server deployment
server: ServerMovieNight static/main.wasm
# Build used for deploying to my server.
# Bulid used for deploying to my server.
ServerMovieNight: *.go common/*.go
GOOS=${OS} GOARCH=${ARCH} go$(GO_VERSION) build -o MovieNight $(TAGS)
GOOS=${TARGET} GOARCH=${ARCH} go$(GO_VERSION) build -o MovieNight $(TAGS)
setdev:
$(eval export TAGS=-tags "dev")
@ -29,7 +32,7 @@ setdev:
dev: setdev all
MovieNight$(EXT): *.go common/*.go
GOOS=${OS} GOARCH=${ARCH} go$(GO_VERSION) build -o $@ $(TAGS)
go$(GO_VERSION) build -o $@ $(TAGS)
static/js/wasm_exec.js:
cp $$(go env GOROOT)/misc/wasm/wasm_exec.js $@

View File

@ -1,9 +1,6 @@
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc -->
**Table of Contents**
<<<<<<< HEAD
=======
>>>>>>> Changed EOL into readme.md
- [MovieNight stream server](#movienight-stream-server)
- [Build requirements](#build-requirements)
- [Older Go Versions](#older-go-versions)
@ -19,10 +16,7 @@
<!-- markdown-toc end -->
# MovieNight stream server
<<<<<<< HEAD
=======
>>>>>>> Changed EOL into readme.md
[![Build status](https://api.travis-ci.org/zorchenhimer/MovieNight.svg?branch=master)](https://travis-ci.org/zorchenhimer/MovieNight)
This is a single-instance streaming server with chat. Originally written to
@ -30,18 +24,11 @@ replace Rabbit as the platform for watching movies with a group of people
online.
## Build requirements
<<<<<<< HEAD
=======
>>>>>>> Changed EOL into readme.md
- Go 1.13 or newer
- GNU Make
### Older Go Versions
<<<<<<< HEAD
=======
>>>>>>> Changed EOL into readme.md
You can install a newer version of Go alongside your OS's distribution by
following the guide here: [https://golang.org/doc/install#extra_versions](https://golang.org/doc/install#extra_versions)
@ -57,11 +44,7 @@ You have to :
- build **make TARGET=windows ARCH=386**;
- and run **./MovieNight**;
<<<<<<< HEAD
Example :
=======
Example :
>>>>>>> Changed EOL into readme.md
```bash
$ git clone https://github.com/zorchenhimer/MovieNight
$ cd MovieNight
@ -107,13 +90,11 @@ This docker-compose file will create a volume called *movienight-config* and aut
The container needs to be restarted to apply any changes you make to *settings.json*.
### FreeNAS - FreeBSD build and run
An script wich setup an Jail and build and run MovieNight into that Jail as been writen, you'll find it here [freenas-iocage-movienight] (https://github.com/zorglube/freenas-iocage-movienight)
## Usage
<<<<<<< HEAD
=======
>>>>>>> Changed EOL into readme.md
Now you can use OBS to push a stream to the server. Set the stream URL to
```text
@ -158,10 +139,7 @@ Usage of .\MovieNight.exe:
```
## Configuration
<<<<<<< HEAD
=======
>>>>>>> Changed EOL into readme.md
MovieNights configuration is controlled by `settings.json`:
- `AdminPassword`: users can enter `/auth <value>` into chat to grant themselves
@ -201,8 +179,5 @@ MovieNights configuration is controlled by `settings.json`:
header, to prevent caching responses.
## License
<<<<<<< HEAD
=======
>>>>>>> Changed EOL into readme.md
`flv.js` is Licensed under the Apache 2.0 license. This project is licened under the MIT license.