Skip to content

Commit

Permalink
✨ Add lots of SwiftPM targets
Browse files Browse the repository at this point in the history
  • Loading branch information
phatblat committed May 17, 2020
1 parent c52859e commit 0c2b2ce
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
#
# https://github.com/phatblat/Makefile-swift

################################################################################
#
# Variables
#

CMD_NAME = signpass
SHELL = /bin/sh

# trunk
Expand All @@ -25,7 +31,7 @@ SWIFTC_FLAGS =
LINKER_FLAGS = -Xlinker -L/usr/local/lib
PLATFORM = x86_64-apple-macosx
EXECUTABLE_DIRECTORY = ./.build/${PLATFORM}/debug
TEST_BUNDLE = CHANGEMEPackageTests.xctest
TEST_BUNDLE = ${CMD_NAME}PackageTests.xctest
TEST_RESOURCES_DIRECTORY = ./.build/${PLATFORM}/debug/${TEST_BUNDLE}/Contents/Resources
endif
ifeq ($(UNAME), Linux)
Expand All @@ -39,6 +45,26 @@ endif

RUN_RESOURCES_DIRECTORY = ${EXECUTABLE_DIRECTORY}

################################################################################
#
# Targets
#

.PHONY: build copyRunResources copyTestResources dependencies describe distclean
.PHONY: init list resolve run test update version xcproj

describe:
swift package describe

resolve:
swift package resolve

dependencies: resolve
swift package show-dependencies

update: resolve
swift package update

xcproj:
swift package generate-xcodeproj

Expand All @@ -56,11 +82,13 @@ copyTestResources:
mkdir -p ${TEST_RESOURCES_DIRECTORY}
cp -r Resources/* ${TEST_RESOURCES_DIRECTORY}

# make run ARGS="asdf"
run: build
${EXECUTABLE_DIRECTORY}/ResourceHandlingSample
${EXECUTABLE_DIRECTORY}/${CMD_NAME} $(ARGS)

clean:
swift package clean
swift package reset

distclean:
rm -rf Packages
Expand All @@ -79,4 +107,5 @@ ifeq ($(UNAME), Linux)
make && make install
endif

.PHONY: build test distclean init run copyRunResources copyTestResources xcproj
version:
swift package tools-version

0 comments on commit 0c2b2ce

Please sign in to comment.