Skip to content

Commit

Permalink
Updated makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
bsneed committed Mar 27, 2024
1 parent f51d8fb commit aedf58c
Showing 1 changed file with 27 additions and 28 deletions.
55 changes: 27 additions & 28 deletions Makefile
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)

0 comments on commit aedf58c

Please sign in to comment.