From 1c63eabc477ee59ca7871f440547911073032b0d Mon Sep 17 00:00:00 2001 From: Andrew Schleifer Date: Tue, 21 May 2013 22:41:31 -0500 Subject: [PATCH] Add Makefile Also set version automatically --- Info.plist | 6 +++++- Makefile | 28 ++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 Makefile diff --git a/Info.plist b/Info.plist index e38a789..9f7f610 100644 --- a/Info.plist +++ b/Info.plist @@ -19,7 +19,11 @@ CFBundleSignature slfe CFBundleVersion - 2.5 + 0 + CFBundleShortVersionString + 0 + CFBundleGitVersionString + 0 NSMainNibFile MainMenu NSPrincipalClass diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..52274ce --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +SOURCE={*/,}*.{h,m} +APP=Slife +DATE=`date +%Y.%m.%d` +BUILD=`git log --oneline | wc -l` +COMMIT=`git rev-parse --verify HEAD` + +DEFAULT: debug + +debug: debug-build + ./build/Debug/$(APP).app/Contents/MacOS/$(APP) +debug-build: $(SOURCE) + xcodebuild -configuration Debug build OBJROOT=build SYMROOT=build + +release: release-app + git tag -a $(DATE) -m"$(DATE)" + cd build/Release && zip -9r ../../$(APP)-$(DATE).zip $(APP).app +release-app: release-build + /usr/libexec/PlistBuddy \ + -c "Set :CFBundleShortVersionString $(DATE)" \ + -c "Set :CFBundleGitVersionString $(COMMIT)" \ + -c "Set :CFBundleVersion $(BUILD)" \ + build/Release/$(APP).app/Contents/Info.plist +release-build: $(SOURCE) + xcodebuild -configuration Release build OBJROOT=build SYMROOT=build + +clobber: + rm -r build +