-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
executable file
·66 lines (50 loc) · 1.86 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Copyright Vadim Eisenberg 2017
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# set EXECUTABLE_DIRECTORY according to your specific environment
# run swift build and see where the output executable is created
# this is a stripped down version of the file documented at
# https://stackoverflow.com/a/47243701
# which came with the above license
prefix ?= /usr/local
bindir ?= $(prefix)/bin
libdir ?= $(prefix)/lib
REPODIR = $(shell pwd)
BUILDDIR = $(REPODIR)/.build
EXECUTABLE_DIRECTORY = ./.build/x86_64-apple-macosx/debug
TEST_RESOURCES_DIRECTORY = ./.build/x86_64-apple-macosx/debug/xcprojectlintPackageTests.xctest/Contents/Resources/
error:
@echo "Please choose one of the following targets: build, clean, test, xcode"
exit 2
build:
swift build
release:
swift build --configuration release --disable-sandbox --build-path "$(BUILDDIR)"
install: release
@install -d "$(bindir)" "$(libdir)"
@install "$(BUILDDIR)/release/xcprojectlint" "$(bindir)"
uninstall:
@rm -rf "$(bindir)/xcprojectlint"
copyTestResources: build
mkdir -p ${TEST_RESOURCES_DIRECTORY}
cp -r TestData ${TEST_RESOURCES_DIRECTORY}
run: build
${EXECUTABLE_DIRECTORY}/xcprojectlint
test: copyTestResources
swift test
xcode:
swift package generate-xcodeproj
@echo "To run the unit tests, refer to “README.md”."
clean:
swift package reset
.PHONY: run build install uninstall test copyTestResources clean xcode