]> git.r.bdr.sh - rbdr/lyricli/blame - Makefile
Create build folder before documenting
[rbdr/lyricli] / Makefile
CommitLineData
169297c8
BB
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)
6a628388 10swift_version = 5.0.1
169297c8
BB
11
12# Default to release configuration on install
13install: configuration = release
14
15default: build
16
97f47198
BB
17prebuild:
18 mkdir -p $(build_path)
19
20build: prebuild
169297c8
BB
21 swift build --build-path $(build_path) --configuration $(configuration)
22
23install: build
24 cp $(source_binary_path) $(install_binary_path)
25
26test: build
27 swift test
28
307993a0
BB
29lint:
30 cd Sources && swiftlint
31
97f47198 32document: prebuild
0a349ded
BB
33 sourcekitten doc --spm-module $(source_binary_name) > $(build_path)/$(source_binary_name).json
34 jazzy \
35 -s $(build_path)/$(source_binary_name).json \
36 --readme README.md \
37 --clean \
38 --author Lyricli \
ffca0db7
BB
39 --author_url https://gitlab.com/lyricli \
40 --github_url https://gitlab.com/lyricli/lyricli \
101a6ecc 41 --module-version 1.0.0 \
0a349ded
BB
42 --module Lyricli \
43
169297c8 44clean:
c32d8723 45 swift package clean
169297c8 46
6a628388
BB
47docker-build:
48 docker build --force-rm --build-arg swift_version=$(swift_version) -t lyriclitest/swift:$(swift_version) .
49
50docker-push: docker-build
51 docker push lyriclitest/swift:$(swift_version)
52
53.PHONY: build install test clean lint docker-build docker-push