Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
# Version and build configuration variables
BUILD_CONFIGURATION ?= debug
WARNINGS_AS_ERRORS ?= true
SWIFT_CONFIGURATION = $(if $(filter-out false,$(WARNINGS_AS_ERRORS)),-Xswiftc -warnings-as-errors)
SWIFT_CONFIGURATION := $(if $(filter-out false,$(WARNINGS_AS_ERRORS)),-Xswiftc -warnings-as-errors)
export RELEASE_VERSION ?= $(shell git describe --tags --always)
export GIT_COMMIT := $(shell git rev-parse HEAD)

# Commonly used locations
SWIFT := "/usr/bin/swift"
DESTDIR ?= /usr/local/
DEST_DIR ?= /usr/local/
ROOT_DIR := $(shell git rev-parse --show-toplevel)
BUILD_BIN_DIR = $(shell $(SWIFT) build -c $(BUILD_CONFIGURATION) --show-bin-path)
COV_DATA_DIR = $(shell $(SWIFT) test --show-coverage-path | xargs dirname)
Expand Down Expand Up @@ -60,7 +60,7 @@ build:
.PHONY: container
# Install binaries under project directory
container: build
@"$(MAKE)" BUILD_CONFIGURATION=$(BUILD_CONFIGURATION) DESTDIR="$(ROOT_DIR)/" SUDO= install
@"$(MAKE)" BUILD_CONFIGURATION=$(BUILD_CONFIGURATION) DEST_DIR="$(ROOT_DIR)/" SUDO= install

.PHONY: release
release: BUILD_CONFIGURATION = release
Expand All @@ -76,7 +76,7 @@ install: installer-pkg
@if [ -z "$(SUDO)" ] ; then \
temp_dir=$$(mktemp -d) ; \
xar -xf $(PKG_PATH) -C $${temp_dir} ; \
(cd $${temp_dir} && tar -xf Payload -C "$(DESTDIR)") ; \
(cd $${temp_dir} && tar -xf Payload -C "$(DEST_DIR)") ; \
rm -rf $${temp_dir} ; \
else \
$(SUDO) installer -pkg $(PKG_PATH) -target / ; \
Expand Down
4 changes: 2 additions & 2 deletions scripts/install-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

SWIFT="/usr/bin/swift"
IMAGE_NAME="vminit:latest"
DESTDIR="${1:-$(git rev-parse --show-toplevel)/bin}"
mkdir -p "${DESTDIR}"
DEST_DIR="${1:-$(git rev-parse --show-toplevel)/bin}"
mkdir -p "${DEST_DIR}"

CONTAINERIZATION_VERSION="$(${SWIFT} package show-dependencies --format json | jq -r '.dependencies[] | select(.identity == "containerization") | .version')"
if [ "${CONTAINERIZATION_VERSION}" == "unspecified" ] ; then
Expand Down