-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
50 lines (39 loc) · 1.47 KB
/
Makefile
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
49
50
SHELL = /bin/bash
ifeq ($(shell uname),Darwin)
EXTRA_SWIFT_FLAGS = --arch arm64 --arch x86_64 --disable-sandbox -Xlinker -dead_strip
else
SWIFT_TOOLCHAIN = $(shell dirname $(shell ./Scripts/locateswift.sh))
EXTRA_SWIFT_FLAGS = -Xswiftc -static-stdlib -Xlinker -fuse-ld=lld -Xlinker -L${SWIFT_TOOLCHAIN}/swift/linux -Xlinker -rpath -Xlinker '$$ORIGIN/../lib'
endif
.PHONY: test
test:
@swift test
.PHONY: check-version
check-version:
@Scripts/check-version.py
.PHONY: test-generated-artifacts
test-generated-artifacts:
@$(MAKE) generate
@git diff --exit-code
.PHONY: build
build:
@swift build --configuration release -Xswiftc -warnings-as-errors ${EXTRA_SWIFT_FLAGS}
.PHONY: generate
generate: generate-explainers generate-completion-scripts
.PHONY: generate-explainers
generate-explainers:
@Scripts/generateexplainers.py 'Documentation/Explainers' > Sources/Critic/explainers.swift
.PHONY: generate-completion-scripts
generate-completion-scripts:
@swift run drstring --generate-completion-script zsh > Scripts/completions/zsh/_drstring
@swift run drstring --generate-completion-script bash > Scripts/completions/bash/drstring-completion.bash
@swift run drstring --generate-completion-script fish > Scripts/completions/drstring.fish
.PHONY: build-docker
build-docker:
@docker build --platform linux/amd64 --force-rm --tag drstring .
.PHONY: package-darwin
package-darwin: build
@Scripts/package-darwin.sh
.PHONY: package-ubuntu
package-ubuntu:
@Scripts/ubuntuarchive.sh 5.9.2 focal amd64