Skip to content

Commit

Permalink
Add Makefile
Browse files Browse the repository at this point in the history
Also set version automatically
  • Loading branch information
andrewschleifer committed May 22, 2013
1 parent bfbd349 commit 1c63eab
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
<key>CFBundleSignature</key>
<string>slfe</string>
<key>CFBundleVersion</key>
<string>2.5</string>
<string>0</string>
<key>CFBundleShortVersionString</key>
<string>0</string>
<key>CFBundleGitVersionString</key>
<string>0</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
Expand Down
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1c63eab

Please sign in to comment.