Skip to content

Commit 7e4eadd

Browse files
authored
Improvements to Makefile (#822)
1 parent ea26cce commit 7e4eadd

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
# Version and build configuration variables
1616
BUILD_CONFIGURATION ?= debug
1717
WARNINGS_AS_ERRORS ?= true
18-
SWIFT_CONFIGURATION = $(if $(filter-out false,$(WARNINGS_AS_ERRORS)),-Xswiftc -warnings-as-errors)
18+
SWIFT_CONFIGURATION := $(if $(filter-out false,$(WARNINGS_AS_ERRORS)),-Xswiftc -warnings-as-errors)
1919
export RELEASE_VERSION ?= $(shell git describe --tags --always)
2020
export GIT_COMMIT := $(shell git rev-parse HEAD)
2121

2222
# Commonly used locations
2323
SWIFT := "/usr/bin/swift"
24-
DESTDIR ?= /usr/local/
24+
DEST_DIR ?= /usr/local/
2525
ROOT_DIR := $(shell git rev-parse --show-toplevel)
2626
BUILD_BIN_DIR = $(shell $(SWIFT) build -c $(BUILD_CONFIGURATION) --show-bin-path)
2727
COV_DATA_DIR = $(shell $(SWIFT) test --show-coverage-path | xargs dirname)
@@ -60,7 +60,7 @@ build:
6060
.PHONY: container
6161
# Install binaries under project directory
6262
container: build
63-
@"$(MAKE)" BUILD_CONFIGURATION=$(BUILD_CONFIGURATION) DESTDIR="$(ROOT_DIR)/" SUDO= install
63+
@"$(MAKE)" BUILD_CONFIGURATION=$(BUILD_CONFIGURATION) DEST_DIR="$(ROOT_DIR)/" SUDO= install
6464

6565
.PHONY: release
6666
release: BUILD_CONFIGURATION = release
@@ -76,7 +76,7 @@ install: installer-pkg
7676
@if [ -z "$(SUDO)" ] ; then \
7777
temp_dir=$$(mktemp -d) ; \
7878
xar -xf $(PKG_PATH) -C $${temp_dir} ; \
79-
(cd $${temp_dir} && tar -xf Payload -C "$(DESTDIR)") ; \
79+
(cd $${temp_dir} && tar -xf Payload -C "$(DEST_DIR)") ; \
8080
rm -rf $${temp_dir} ; \
8181
else \
8282
$(SUDO) installer -pkg $(PKG_PATH) -target / ; \

scripts/install-init.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

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

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

0 commit comments

Comments
 (0)