mas/Makefile

144 lines
2.8 KiB
Makefile
Raw Normal View History

2020-05-29 05:09:24 +00:00
#
# Makefile
# mas
#
################################################################################
#
# Variables
#
CMD_NAME = mas
SHELL = /bin/sh
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
2022-09-22 01:27:32 +00:00
SWIFT_VERSION = 5.7
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
2022-07-04 23:29:28 +00:00
################################################################################
#
# Help
#
.DEFAULT_GOAL := help
.PHONY: help
help: MAKEFILE_FMT = " \033[36m%-25s\033[0m%s\n"
help: ## (default) Displays this message
2022-09-22 01:27:32 +00:00
@echo "mas Makefile"
2022-07-04 23:29:28 +00:00
@echo ""
@echo "Targets:"
@grep -E '^[a-zA-Z0-9_-]*:.*?##' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?##"}; {printf $(MAKEFILE_FMT), $$1, $$2}'
: # Hacky way to display a newline ##
2020-05-29 05:09:24 +00:00
################################################################################
#
# Targets
#
.PHONY: version
2022-07-04 23:29:28 +00:00
version: ## Prints versions of tools used by this Makefile.
2020-05-29 05:09:24 +00:00
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
2022-07-04 23:29:28 +00:00
init: ## Installs tools.
2020-05-29 05:09:24 +00:00
- swiftenv install $(SWIFT_VERSION)
swiftenv local $(SWIFT_VERSION)
.PHONY: bootstrap
2022-07-04 23:29:28 +00:00
bootstrap: ## Installs tools.
2020-05-29 05:09:24 +00:00
script/bootstrap
.PHONY: clean
2022-07-04 23:29:28 +00:00
clean: ## Cleans built products.
2020-05-29 05:09:24 +00:00
script/clean
.PHONY: updateHeaders
2022-07-04 23:29:28 +00:00
updateHeaders: ## Updates private headers.
2020-05-29 05:09:24 +00:00
script/update_headers
.PHONY: build
2022-07-04 23:29:28 +00:00
build: ## Builds the project.
2020-05-29 05:09:24 +00:00
script/build
.PHONY: test
2022-07-04 23:29:28 +00:00
test: build ## Runs tests.
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
2022-07-04 23:29:28 +00:00
install: ## Installs the project.
script/install $(PREFIX)
2020-05-29 05:09:24 +00:00
.PHONY: uninstall
2022-07-04 23:29:28 +00:00
uninstall: ## Uninstalls the project.
2020-05-29 05:09:24 +00:00
script/uninstall
2021-05-07 18:39:13 +00:00
.PHONY: format
2022-07-04 23:29:28 +00:00
format: ## Formats source code.
2021-05-07 18:39:13 +00:00
script/format
2020-05-29 05:09:24 +00:00
.PHONY: lint
2022-07-04 23:29:28 +00:00
lint: ## Lints source code.
2020-05-29 05:09:24 +00:00
script/lint
.PHONY: danger
2022-07-04 23:29:28 +00:00
danger: ## Runs danger.
2020-05-29 05:09:24 +00:00
script/danger
# Builds bottles
.PHONY: bottles
2022-07-04 23:29:28 +00:00
bottles: ## Builds bottles.
2020-05-29 05:09:24 +00:00
script/bottle
.PHONY: bottle
2022-07-04 23:29:28 +00:00
bottle: bottles ## Alias for bottles
2020-05-29 05:09:24 +00:00
.PHONY: package
2022-07-04 23:29:28 +00:00
package: build ## Packages the project.
2020-05-29 05:09:24 +00:00
script/package
.PHONY: packageInstall
2022-07-04 23:29:28 +00:00
packageInstall: package ## Installs the package.
2020-05-29 05:09:24 +00:00
script/package_install
2021-05-07 18:39:13 +00:00
.PHONY: describe
2022-07-04 23:29:28 +00:00
describe: ## Describes the Swift package.
2021-05-07 18:39:13 +00:00
swift package describe
2020-05-29 05:09:24 +00:00
2021-05-07 18:39:13 +00:00
.PHONY: resolve
2022-07-04 23:29:28 +00:00
resolve: ## Resolves SwiftPM dependencies.
2021-05-07 18:39:13 +00:00
swift package resolve
2020-05-29 05:09:24 +00:00
2021-05-07 18:39:13 +00:00
.PHONY: dependencies
2022-07-04 23:29:28 +00:00
dependencies: resolve ## Lists SwiftPM dependencies.
2021-05-07 18:39:13 +00:00
swift package show-dependencies
2020-05-29 05:09:24 +00:00
2021-05-07 18:39:13 +00:00
.PHONY: update
2022-07-04 23:29:28 +00:00
update: resolve ## Updates SwiftPM dependencies.
2021-05-07 18:39:13 +00:00
swift package update