-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
27 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,35 @@ | ||
# | ||
# Makefile | ||
# swift-create-xcframework | ||
# | ||
# Created by Rob Amos on 7/5/20. | ||
# | ||
SHELL = /bin/bash | ||
|
||
PRODUCT := swift-create-xcframework | ||
INSTALL_DIR := /usr/local/bin | ||
prefix ?= /usr/local | ||
bindir ?= $(prefix)/bin | ||
libdir ?= $(prefix)/lib | ||
srcdir = Sources | ||
|
||
# Override this on the command line if you need to | ||
BUILD_FLAGS := | ||
REPODIR = $(shell pwd) | ||
BUILDDIR = $(REPODIR)/.build | ||
SOURCES = $(wildcard $(srcdir)/**/*.swift) | ||
|
||
.PHONY: build build-release install install-debug | ||
.DEFAULT_GOAL = all | ||
|
||
default: build | ||
build: build-debug | ||
swift-create-xcframework: $(SOURCES) | ||
@swift build \ | ||
-c release \ | ||
--disable-sandbox \ | ||
--build-path "$(BUILDDIR)" | ||
|
||
# Release Builds | ||
.PHONY: install | ||
install: swift-create-xcframework | ||
@install -d "$(bindir)" | ||
@install "$(wildcard $(BUILDDIR)/**/release/swift-create-xcframework)" "$(bindir)" | ||
|
||
build-release: $(wildcard Sources/*/*.swift) | ||
swift build $(BUILD_FLAGS) --configuration release | ||
.PHONY: uninstall | ||
uninstall: | ||
@rm -rf "$(bindir)/swift-create-xcframework" | ||
|
||
install: build-release | ||
cp .build/release/swift-create-xcframework $(INSTALL_DIR)/$(PRODUCT) | ||
touch -c $(INSTALL_DIR)/$(PRODUCT) | ||
|
||
# Debug builds | ||
|
||
build-debug: $(wildcard Sources/*/*.swift) | ||
swift build $(BUILD_FLAGS) --configuration debug | ||
|
||
install-debug: build-debug | ||
cp .build/debug/swift-create-xcframework $(INSTALL_DIR)/$(PRODUCT) | ||
touch -c $(INSTALL_DIR)/$(PRODUCT) | ||
.PHONY: clean | ||
distclean: | ||
@rm -f $(BUILDDIR)/release | ||
|
||
.PHONY: clean | ||
clean: distclean | ||
@rm -rf $(BUILDDIR) |