Skip to content

Commit

Permalink
Add archive Makefile command
Browse files Browse the repository at this point in the history
  • Loading branch information
keith committed Aug 13, 2017
1 parent deab989 commit a5c821d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,6 @@ xcuserdata
# Carthage/Checkouts

Carthage/Build

contacts
contacts.tar.gz
Expand Down
24 changes: 14 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
BUILD=build
EXECUTABLE=contacts
PREFIX?=/usr/local/bin
EXECUTABLE = contacts
ARCHIVE = $(EXECUTABLE).tar.gz
PREFIX ?= /usr/local/bin

.PHONY: build clean install uninstall
.PHONY: archive clean install uninstall
SRC=$(wildcard Sources/*.swift)

build: $(SRC)
mkdir -p $(BUILD)
$(EXECUTABLE): $(SRC)
swiftc \
-static-stdlib \
-O -whole-module-optimization \
-o $(BUILD)/$(EXECUTABLE) \
-o $(EXECUTABLE) \
-sdk $(shell xcrun --sdk macosx --show-sdk-path) \
-target x86_64-macosx10.10 \
$(SRC)

install: build
install $(BUILD)/$(EXECUTABLE) $(PREFIX)
install: $(EXECUTABLE)
install $(EXECUTABLE) $(PREFIX)

uninstall:
rm "$(PREFIX)/$(EXECUTABLE)"

archive: $(EXECUTABLE)
tar -pvczf $(ARCHIVE) $(EXECUTABLE)
@shasum -a 256 $(EXECUTABLE)
@shasum -a 256 $(ARCHIVE)

clean:
rm -rf $(BUILD)
rm -rf $(ARCHIVE) $(EXECUTABLE)

0 comments on commit a5c821d

Please sign in to comment.