Minor Build Script Updates, Mac OS Support

* Update the Makefile to choose MacOS friendly `date` formats.
* Build the Windows doodle.exe binary as a GUI application to skip the
  console window.
* Added Mac OS build instructions.
This commit is contained in:
Noah 2019-07-08 18:16:45 -07:00
parent 154fc6c9cb
commit 0126c288b2
5 changed files with 18 additions and 7 deletions

View File

@ -1,5 +1,9 @@
# Building Doodle # Building Doodle
* [Linux](#linux)
* [Windows Cross-Compile from Linux](#windows-cross-compile-from-linux)
* [Mac OS](#mac os)
## Fonts ## Fonts
The `fonts/` folder is git-ignored. The app currently uses font files here The `fonts/` folder is git-ignored. The app currently uses font files here
@ -86,6 +90,12 @@ sudo dnf -y install golang SDL2-devel SDL2_ttf-devel
sudo apt -y install golang libsdl2-dev libsdl2-ttf-dev sudo apt -y install golang libsdl2-dev libsdl2-ttf-dev
``` ```
## Mac OS
```bash
brew install golang sdl2 sdl2_ttf pkg-config
```
## Windows Cross-Compile from Linux ## Windows Cross-Compile from Linux
Install the Mingw C compiler: Install the Mingw C compiler:

View File

@ -2,11 +2,12 @@ SHELL := /bin/bash
VERSION=$(shell grep -e 'Version =' pkg/branding/branding.go | head -n 1 | cut -d '"' -f 2) VERSION=$(shell grep -e 'Version =' pkg/branding/branding.go | head -n 1 | cut -d '"' -f 2)
BUILD=$(shell git describe --always) BUILD=$(shell git describe --always)
BUILD_DATE=$(shell date -Iseconds) BUILD_DATE=$(shell date +"%Y-%m-%dT%H:%M:%S%z")
CURDIR=$(shell curdir) CURDIR=$(shell curdir)
# Inject the build version (commit hash) into the executable. # Inject the build version (commit hash) into the executable.
LDFLAGS := -ldflags "-X main.Build=$(BUILD) -X main.BuildDate=$(BUILD_DATE)" LDFLAGS := -ldflags "-X main.Build=$(BUILD) -X main.BuildDate=$(BUILD_DATE)"
LDFLAGS_W := -ldflags "-X main.Build=$(BUILD) -X main.BuildDate=$(BUILD_DATE) -H windowsgui"
# `make setup` to set up a new environment, pull dependencies, etc. # `make setup` to set up a new environment, pull dependencies, etc.
.PHONY: setup .PHONY: setup
@ -75,7 +76,7 @@ doodads:
mingw: doodads bindata mingw: doodads bindata
env CGO_ENABLED="1" CC="/usr/bin/x86_64-w64-mingw32-gcc" \ env CGO_ENABLED="1" CC="/usr/bin/x86_64-w64-mingw32-gcc" \
GOOS="windows" CGO_LDFLAGS="-lmingw32 -lSDL2" CGO_CFLAGS="-D_REENTRANT" \ GOOS="windows" CGO_LDFLAGS="-lmingw32 -lSDL2" CGO_CFLAGS="-D_REENTRANT" \
go build $(LDFLAGS) -i -o bin/doodle.exe cmd/doodle/main.go go build $(LDFLAGS_W) -i -o bin/doodle.exe cmd/doodle/main.go
env CGO_ENABLED="1" CC="/usr/bin/x86_64-w64-mingw32-gcc" \ env CGO_ENABLED="1" CC="/usr/bin/x86_64-w64-mingw32-gcc" \
GOOS="windows" CGO_LDFLAGS="-lmingw32 -lSDL2" CGO_CFLAGS="-D_REENTRANT" \ GOOS="windows" CGO_LDFLAGS="-lmingw32 -lSDL2" CGO_CFLAGS="-D_REENTRANT" \
go build $(LDFLAGS) -i -o bin/doodad.exe cmd/doodad/main.go go build $(LDFLAGS) -i -o bin/doodad.exe cmd/doodad/main.go

View File

@ -14,7 +14,7 @@
**UI Cleanup:** **UI Cleanup:**
- Doodads Palette: - Doodads Palette:
- [ ] Hide some doodads like the player character. - [x] Hide some doodads like the player character.
- [x] Pagination or scrolling UI for long lists of doodads. - [x] Pagination or scrolling UI for long lists of doodads.
**Nice to haves:** **Nice to haves:**
@ -31,9 +31,9 @@
- [ ] Eraser Tool - [ ] Eraser Tool
- [ ] Brush size and/or shape - [ ] Brush size and/or shape
- [ ] Doodad CLI Tool Features - [ ] Doodad CLI Tool Features
- [ ] `doodad show` to display information about a level or doodad. - [x] `doodad show` to display information about a level or doodad.
- [ ] `doodad init` or some such to generate a default JS script. - [ ] `doodad init` or some such to generate a default JS script.
- [ ] Options to toggle various states (hidden, hasInventory?) - [x] Options to toggle various states (hidden, hasInventory?)
**Shareware Version:** **Shareware Version:**

View File

@ -98,7 +98,6 @@ azulians() {
doodad convert -t "Blue Azulian" blu-front.png blu-back.png \ doodad convert -t "Blue Azulian" blu-front.png blu-back.png \
blu-wr{1,2,3,4}.png blu-wl{1,2,3,4}.png azu-blu.doodad blu-wr{1,2,3,4}.png blu-wl{1,2,3,4}.png azu-blu.doodad
doodad edit-doodad -hide azu-blu.doodad
doodad install-script azulian.js azu-blu.doodad doodad install-script azulian.js azu-blu.doodad
doodad convert -t "Red Azulian" red-front.png red-back.png \ doodad convert -t "Red Azulian" red-front.png red-back.png \
@ -128,3 +127,4 @@ trapdoors
azulians azulians
objects objects
doodad edit-doodad -quiet -lock -author "Noah" ../../assets/doodads/*.doodad doodad edit-doodad -quiet -lock -author "Noah" ../../assets/doodads/*.doodad
doodad edit-doodad -hide ../../assets/doodads/azu-blu.doodad

View File

@ -4,5 +4,5 @@ package branding
const ( const (
AppName = "Project: Doodle" AppName = "Project: Doodle"
Summary = "A drawing-based maze game" Summary = "A drawing-based maze game"
Version = "0.0.8-alpha" Version = "0.0.9-alpha"
) )