2020-05-29 05:09:24 +00:00
|
|
|
#
|
|
|
|
# Makefile
|
|
|
|
# mas
|
|
|
|
#
|
|
|
|
|
2021-03-20 15:58:57 +00:00
|
|
|
|
2020-05-29 05:09:24 +00:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# Variables
|
|
|
|
#
|
|
|
|
|
|
|
|
CMD_NAME = mas
|
|
|
|
SHELL = /bin/sh
|
2020-07-30 12:24:38 +00:00
|
|
|
PREFIX ?= /usr/local
|
2020-05-29 05:09:24 +00:00
|
|
|
|
|
|
|
# trunk
|
|
|
|
# SWIFT_VERSION = swift-DEVELOPMENT-SNAPSHOT-2020-04-23-a
|
|
|
|
|
|
|
|
# Swift 5.3
|
|
|
|
# SWIFT_VERSION = swift-5.3-DEVELOPMENT-SNAPSHOT-2020-04-21-a
|
|
|
|
|
2021-03-20 15:58:57 +00:00
|
|
|
SWIFT_VERSION = 5.3.2
|
2020-05-29 05:09:24 +00:00
|
|
|
|
|
|
|
# set EXECUTABLE_DIRECTORY according to your specific environment
|
|
|
|
# run swift build and see where the output executable is created
|
|
|
|
|
|
|
|
# OS specific differences
|
|
|
|
UNAME = ${shell uname}
|
2021-05-07 18:39:13 +00:00
|
|
|
ARCH = ${shell uname -m}
|
2020-05-29 05:09:24 +00:00
|
|
|
|
|
|
|
ifeq ($(UNAME), Darwin)
|
2021-05-07 18:39:13 +00:00
|
|
|
PLATFORM = $(ARCH)-apple-macosx
|
2020-05-29 05:09:24 +00:00
|
|
|
EXECUTABLE_DIRECTORY = ./.build/${PLATFORM}/debug
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# Targets
|
|
|
|
#
|
|
|
|
|
2021-03-20 15:58:29 +00:00
|
|
|
# Prints versions of tools used by this Makefile.
|
2020-05-29 05:09:24 +00:00
|
|
|
.PHONY: version
|
|
|
|
version:
|
|
|
|
xcodebuild -version
|
2021-03-20 15:58:29 +00:00
|
|
|
swiftenv version
|
2020-05-29 05:09:24 +00:00
|
|
|
swift --version
|
2021-05-07 18:39:13 +00:00
|
|
|
swift package tools-version
|
2020-05-29 05:09:24 +00:00
|
|
|
|
|
|
|
.PHONY: init
|
|
|
|
init:
|
|
|
|
- swiftenv install $(SWIFT_VERSION)
|
|
|
|
swiftenv local $(SWIFT_VERSION)
|
|
|
|
|
|
|
|
.PHONY: bootstrap
|
|
|
|
bootstrap:
|
|
|
|
script/bootstrap
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
script/clean
|
|
|
|
|
|
|
|
.PHONY: distclean
|
2021-05-07 18:39:13 +00:00
|
|
|
distclean: clean
|
2020-05-29 05:09:24 +00:00
|
|
|
|
|
|
|
.PHONY: updateHeaders
|
|
|
|
updateHeaders:
|
|
|
|
script/update_headers
|
|
|
|
|
|
|
|
.PHONY: build
|
2021-05-07 18:39:13 +00:00
|
|
|
build:
|
2020-05-29 05:09:24 +00:00
|
|
|
script/build
|
|
|
|
|
|
|
|
.PHONY: test
|
2021-05-07 18:39:13 +00:00
|
|
|
test: build
|
2020-05-29 05:09:24 +00:00
|
|
|
script/test
|
|
|
|
|
|
|
|
# make run ARGS="asdf"
|
|
|
|
.PHONY: run
|
|
|
|
run: build
|
|
|
|
${EXECUTABLE_DIRECTORY}/${CMD_NAME} $(ARGS)
|
|
|
|
|
|
|
|
.PHONY: install
|
|
|
|
install:
|
2020-07-30 12:24:38 +00:00
|
|
|
script/install $(PREFIX)
|
2020-05-29 05:09:24 +00:00
|
|
|
|
|
|
|
.PHONY: uninstall
|
|
|
|
uninstall:
|
|
|
|
script/uninstall
|
|
|
|
|
2021-05-07 18:39:13 +00:00
|
|
|
.PHONY: format
|
2021-05-09 20:25:36 +00:00
|
|
|
format:
|
2021-05-07 18:39:13 +00:00
|
|
|
script/format
|
|
|
|
|
2020-05-29 05:09:24 +00:00
|
|
|
.PHONY: lint
|
|
|
|
lint:
|
|
|
|
script/lint
|
|
|
|
|
|
|
|
.PHONY: danger
|
|
|
|
danger:
|
|
|
|
script/danger
|
|
|
|
|
2021-03-20 18:29:15 +00:00
|
|
|
# Builds bottles
|
|
|
|
.PHONY: bottles
|
|
|
|
bottles:
|
2020-05-29 05:09:24 +00:00
|
|
|
script/bottle
|
|
|
|
|
2021-03-20 18:29:15 +00:00
|
|
|
# Alias for bottles
|
|
|
|
.PHONY: bottle
|
|
|
|
bottle: bottles
|
|
|
|
|
2020-05-29 05:09:24 +00:00
|
|
|
.PHONY: package
|
|
|
|
package:
|
|
|
|
script/package
|
|
|
|
|
|
|
|
.PHONY: packageInstall
|
|
|
|
packageInstall:
|
|
|
|
script/package_install
|
|
|
|
|
2021-05-07 18:39:13 +00:00
|
|
|
.PHONY: describe
|
|
|
|
describe:
|
|
|
|
swift package describe
|
2020-05-29 05:09:24 +00:00
|
|
|
|
2021-05-07 18:39:13 +00:00
|
|
|
.PHONY: resolve
|
|
|
|
resolve:
|
|
|
|
swift package resolve
|
2020-05-29 05:09:24 +00:00
|
|
|
|
2021-05-07 18:39:13 +00:00
|
|
|
.PHONY: dependencies
|
|
|
|
dependencies: resolve
|
|
|
|
swift package show-dependencies
|
2020-05-29 05:09:24 +00:00
|
|
|
|
2021-05-07 18:39:13 +00:00
|
|
|
.PHONY: update
|
|
|
|
update: resolve
|
|
|
|
swift package update
|