Skip to content

Commit

Permalink
Adds release makefile targets
Browse files Browse the repository at this point in the history
  • Loading branch information
denibertovic committed Jan 9, 2016
1 parent 4d24778 commit 83574af
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/out/*
/statements/*
/.stack-work
/release
34 changes: 32 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,43 @@

.PHONY = build run
.PHONY = build run static-build clean release

VERSION=0.1.0.0
ARCH=$(shell uname -m)

BINARY_NAME=s2hl


build:
@stack build

run:
@`pwd`/.stack-work/install/x86_64-linux/lts-3.16/7.10.2/bin/s2hl-exe \
@`pwd`/.stack-work/install/x86_64-linux/lts-3.16/7.10.2/bin/{BINARY_NAME}-exe \
--statements-dir `pwd`/statements \
--output-dir `pwd`/out \
--currency USD \
--currency HRK

static-build: clean
@mkdir -p release/build
@stack ghc -- \
app/Main.hs \
src/S2HL/Lib.hs \
src/S2HL/Options.hs \
src/S2HL/Types.hs \
-static \
-rtsopts=all \
-optl-pthread \
-optl-static \
-O2 \
-threaded \
-odir release/build \
-hidir release/build \
-o release/${BINARY_NAME}-${VERSION}-linux-${ARCH}

clean:
@rm -rf release

release: static-build
@echo "\n\nRelease available at:\n"
@echo "STATIC BINARY: `pwd`/release/{BINARY_NAME}-${VERSION}-linux-${ARCH}\n"

0 comments on commit 83574af

Please sign in to comment.