From 115419b2cb97f2bf38e5eff74f9e28830e3f8cce Mon Sep 17 00:00:00 2001 From: Mattt Date: Thu, 26 Sep 2019 07:51:53 -0700 Subject: [PATCH 1/3] Add install target to Makefile --- Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 26bf318..50eb82c 100755 --- a/Makefile +++ b/Makefile @@ -19,6 +19,13 @@ # https://stackoverflow.com/a/47243701 # which came with the above license +prefix ?= /usr/local +bindir ?= $(prefix)/bin +libdir ?= $(prefix)/lib + +REPODIR = $(shell pwd) +BUILDDIR = $(REPODIR)/.build + EXECUTABLE_DIRECTORY = ./.build/x86_64-apple-macosx/debug TEST_RESOURCES_DIRECTORY = ./.build/x86_64-apple-macosx/debug/xcprojectlintPackageTests.xctest/Contents/Resources/ @@ -32,6 +39,10 @@ build: release: swift build --configuration release +install: release + @install -d "$(bindir)" "$(libdir)" + @install "$(BUILDDIR)/release/xcprojectlint" "$(bindir)" + copyTestResources: build mkdir -p ${TEST_RESOURCES_DIRECTORY} cp -r TestData ${TEST_RESOURCES_DIRECTORY} @@ -49,4 +60,4 @@ xcode: clean: swift package reset -.PHONY: run build test copyTestResources clean xcode +.PHONY: run build install test copyTestResources clean xcode From 5975587bf1c08e39df15a10660db192098033473 Mon Sep 17 00:00:00 2001 From: Mattt Date: Thu, 26 Sep 2019 07:55:06 -0700 Subject: [PATCH 2/3] Add uninstall target to Makefile --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 50eb82c..7b365d3 100755 --- a/Makefile +++ b/Makefile @@ -43,6 +43,9 @@ install: release @install -d "$(bindir)" "$(libdir)" @install "$(BUILDDIR)/release/xcprojectlint" "$(bindir)" +uninstall: + @rm -rf "$(bindir)/xcprojectlint" + copyTestResources: build mkdir -p ${TEST_RESOURCES_DIRECTORY} cp -r TestData ${TEST_RESOURCES_DIRECTORY} @@ -60,4 +63,4 @@ xcode: clean: swift package reset -.PHONY: run build install test copyTestResources clean xcode +.PHONY: run build install uninstall test copyTestResources clean xcode From 0c0e41d91fb6c45f57dce27d2fcc568596ece4ef Mon Sep 17 00:00:00 2001 From: Mattt Date: Thu, 26 Sep 2019 08:03:42 -0700 Subject: [PATCH 3/3] Add --disable-sandbox and --build-path options to swift build command for release target --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7b365d3..e307b3a 100755 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ build: swift build release: - swift build --configuration release + swift build --configuration release --disable-sandbox --build-path "$(BUILDDIR)" install: release @install -d "$(bindir)" "$(libdir)"