~sschwarzer/sudoku-solver

sudoku-solver/Makefile -rw-r--r-- 1.1 KiB
fc2397a8Stefan Schwarzer Adapt artifacts for changed build target directory 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
VERSION=$(shell cat VERSION)

# Create standalone binaries for different platforms.
.PHONY : build-binaries
build-binaries:
	raco exe-multitarget \
		--targets x86_64-linux,x86_64-win32,x86_64-macosx,aarch64-macosx \
		--version "${VERSION}" \
		--build-directory-template "build" \
		--launcher-name-template "{launcher-name}-{version}-{nice-target}" \
		games/sudoku-solver.rkt

.PHONY : build-source
build-source:
	git archive -o build/sudoku-solver-${VERSION}.zip HEAD

.PHONY : build-all
build-all: build-binaries build-source

.PHONY : patch
patch:
	sed -i 's/(define version .*/(define version "${VERSION}")/' info.rkt
	sed -i -E 's/^(- sudoku-solver.*-)[0-9]+\.[0-9]+\.[0-9]+(-pre)?(.*)/\1${VERSION}\3/' .build.yml

.PHONY : test
test:
	raco test games/sudoku-solver

.PHONY : tag
tag:
	git tag -a "v${VERSION}"

.PHONY : push
push:
	git push
	git push --tags

.PHONY : copy-to-releases
copy-to-releases:
	cp $(shell find build/ -name "sudoku-solver-${VERSION}-*") \
		../../releases/_site/sudoku-solver

# Upload to webspace.
.PHONY : upload
upload:

.PHONY : release
release: patch build-all tag push copy-to-releases upload