Skip to content

Commit 83574af

Browse files
committed
Adds release makefile targets
1 parent 4d24778 commit 83574af

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/out/*
22
/statements/*
33
/.stack-work
4+
/release

Makefile

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,43 @@
11

2-
.PHONY = build run
2+
.PHONY = build run static-build clean release
3+
4+
VERSION=0.1.0.0
5+
ARCH=$(shell uname -m)
6+
7+
BINARY_NAME=s2hl
8+
39

410
build:
511
@stack build
612

713
run:
8-
@`pwd`/.stack-work/install/x86_64-linux/lts-3.16/7.10.2/bin/s2hl-exe \
14+
@`pwd`/.stack-work/install/x86_64-linux/lts-3.16/7.10.2/bin/{BINARY_NAME}-exe \
915
--statements-dir `pwd`/statements \
1016
--output-dir `pwd`/out \
1117
--currency USD \
1218
--currency HRK
1319

20+
static-build: clean
21+
@mkdir -p release/build
22+
@stack ghc -- \
23+
app/Main.hs \
24+
src/S2HL/Lib.hs \
25+
src/S2HL/Options.hs \
26+
src/S2HL/Types.hs \
27+
-static \
28+
-rtsopts=all \
29+
-optl-pthread \
30+
-optl-static \
31+
-O2 \
32+
-threaded \
33+
-odir release/build \
34+
-hidir release/build \
35+
-o release/${BINARY_NAME}-${VERSION}-linux-${ARCH}
36+
37+
clean:
38+
@rm -rf release
39+
40+
release: static-build
41+
@echo "\n\nRelease available at:\n"
42+
@echo "STATIC BINARY: `pwd`/release/{BINARY_NAME}-${VERSION}-linux-${ARCH}\n"
43+

0 commit comments

Comments
 (0)