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:
parent
fa72c4cf35
commit
745bb322a3
|
@ -47,3 +47,5 @@ tags
|
||||||
|
|
||||||
# channel and emote list from twitch
|
# channel and emote list from twitch
|
||||||
subscribers.json
|
subscribers.json
|
||||||
|
/.settings/
|
||||||
|
/.project
|
||||||
|
|
7
Makefile
7
Makefile
|
@ -5,10 +5,13 @@
|
||||||
# For info on installing extra versions, see this page:
|
# For info on installing extra versions, see this page:
|
||||||
# https://golang.org/doc/install#extra_versions
|
# 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=
|
TAGS=
|
||||||
|
|
||||||
# Windows needs the .exe extension.
|
# Windows needs the .exe extension.
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(TARGET),windows)
|
||||||
EXT=.exe
|
EXT=.exe
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -21,7 +24,7 @@ server: ServerMovieNight static/main.wasm
|
||||||
|
|
||||||
# Bulid used for deploying to my server.
|
# Bulid used for deploying to my server.
|
||||||
ServerMovieNight: *.go common/*.go
|
ServerMovieNight: *.go common/*.go
|
||||||
GOOS=linux GOARCH=386 go$(GO_VERSION) build -o MovieNight $(TAGS)
|
GOOS=${TARGET} GOARCH=${ARCH} go$(GO_VERSION) build -o MovieNight $(TAGS)
|
||||||
|
|
||||||
setdev:
|
setdev:
|
||||||
$(eval export TAGS=-tags "dev")
|
$(eval export TAGS=-tags "dev")
|
||||||
|
|
11
readme.md
11
readme.md
|
@ -37,13 +37,18 @@ set it to the version you installed (eg, `1.14.1`). The Makefile will now use
|
||||||
the newer version.
|
the newer version.
|
||||||
|
|
||||||
### Compile and install
|
### Compile and install
|
||||||
|
You have to :
|
||||||
To just download and run:
|
- download ;
|
||||||
|
- choose your `TARGET` "android darwin dragonfly freebsd linux nacl netbsd openbsd plan9 solaris windows"
|
||||||
|
;
|
||||||
|
- choose you `ARCH` "386 amd64 amd64p32 arm arm64 ppc64 ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32leppc s390 s390x sparc sparc64"
|
||||||
|
;
|
||||||
|
- and run ;
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ git clone https://github.com/zorchenhimer/MovieNight
|
$ git clone https://github.com/zorchenhimer/MovieNight
|
||||||
$ cd MovieNight
|
$ cd MovieNight
|
||||||
$ make
|
$ make TARGET=windows ARCH=386
|
||||||
$ ./MovieNight
|
$ ./MovieNight
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue