]> git.r.bdr.sh - rbdr/lyricli/blame_incremental - Makefile
Add configuration for arch
[rbdr/lyricli] / Makefile
... / ...
CommitLineData
1configuration = debug
2build_path = .build
3
4# These are used to rename the executable to lrc without renaming the package
5source_binary_name = lyricli
6target_binary_name = lrc
7install_path = /usr/local/bin
8source_binary_path = $(build_path)/$(configuration)/$(source_binary_name)
9install_binary_path = $(install_path)/$(target_binary_name)
10swift_version = 5.8.0
11architecture = $(shell uname -m)
12
13# Default to release configuration on install
14install: configuration = release
15
16default: build
17
18build:
19 swift build --build-path $(build_path) --configuration $(configuration) --arch $(architecture) -Xswiftc -cross-module-optimization
20
21install: build
22 sudo cp $(source_binary_path) $(install_binary_path)
23
24test: build
25 swift test
26
27lint:
28 cd Sources && swiftlint
29
30document: build
31 sourcekitten doc --spm-module $(source_binary_name) > $(build_path)/$(source_binary_name).json
32 jazzy \
33 -s $(build_path)/$(source_binary_name).json \
34 --readme README.md \
35 --clean \
36 --author Lyricli \
37 --author_url https://gitlab.com/lyricli \
38 --github_url https://gitlab.com/lyricli/lyricli \
39 --module-version 1.0.0 \
40 --module Lyricli \
41
42clean:
43 swift package clean
44
45docker-build:
46 docker build --force-rm --build-arg swift_version=$(swift_version) -t lyriclitest/swift:$(swift_version) .
47
48docker-push: docker-build
49 docker push lyriclitest/swift:$(swift_version)
50
51.PHONY: build install test clean lint docker-build docker-push