# encoding=utf-8
PRODUCT_NAME=BSInlinePreviewer
PRODUCT_EXTENSION=plugin
BUILD_PATH=./build
DEPLOYMENT=Release
APP_BUNDLE=$(PRODUCT_NAME).$(PRODUCT_EXTENSION)
APP=$(BUILD_PATH)/$(DEPLOYMENT)/$(APP_BUNDLE)
APP_NAME=$(BUILD_PATH)/$(DEPLOYMENT)/$(PRODUCT_NAME)
INFO_PLIST=Info.plist

URL_CMD=LC_ALL=C svn info | awk '/Root/{print $$3}'
URL_BSInlinePreviewer = $(shell $(URL_CMD))
HEAD = $(URL_BSInlinePreviewer)/BSInlinePreviewer
TAGS_DIR = $(URL_BSInlinePreviewer)/tags

VER_CMD=grep -A1 'CFBundleShortVersionString' $(INFO_PLIST) | tail -1 | tr -d "'\t</string>" 
VERSION=$(shell $(VER_CMD))

LocalizeFiles=XspfMLabelMenuView.m \

all:
	@echo do  nothig.
	@echo use target tagging 

tagging: update_svn
	@echo "Tagging the $(VERSION) (x) release of BSInlinePreviewer project."
	@echo ""
	echo svn copy $(HEAD) $(TAGS_DIR)/release-$(VERSION)

Localizable: ${LocalizeFiles}
	genstrings -o English.lproj $^
	(cd English.lproj; ${MAKE} $@;)
	genstrings -o Japanese.lproj $^
	(cd Japanese.lproj; ${MAKE} $@;)

checkLocalizable:
	(cd English.lproj; ${MAKE} $@;)
	(cd Japanese.lproj; ${MAKE} $@;)

release: 
	xcodebuild -configuration $(DEPLOYMENT)

package: release
	ditto -ck -rsrc --keepParent $(APP) $(APP_NAME)-$(VERSION).zip



