Permalink
Switch branches/tags
Find file
Fetching contributors…
Cannot retrieve contributors at this time
78 lines (62 sloc) 2.01 KB
PATH := /usr/bin:/bin:/usr/sbin:/sbin
ORIG_PATH := $(PATH)
PATH := /usr/bin:/bin:/usr/sbin:/sbin
ITERM_PID=$(shell pgrep "iTerm")
APPS := /Applications
ITERM_CONF_PLIST = $(HOME)/Library/Preferences/com.googlecode.iterm2.plist
COMPACTDATE=$(shell date +"%Y%m%d")
VERSION = $(shell cat version.txt | sed -e "s/%(extra)s/$(COMPACTDATE)/")
NAME=$(shell echo $(VERSION) | sed -e "s/\\./_/g")
.PHONY: clean all backup-old-iterm restart
all: Development
dev: Development
prod: Deployment
debug: Development
/Developer/usr/bin/gdb build/Development/iTerm.app/Contents/MacOS/iTerm
TAGS:
find . -name "*.[mhMH]" -exec etags -o ./TAGS -a '{}' +
install: | Deployment backup-old-iterm
cp -r build/Deployment/iTerm.app $(APPS)
Development:
echo "Using PATH for build: $(PATH)"
xcodebuild -parallelizeTargets -alltargets -configuration Development && \
chmod -R go+rX build/Development
Deployment:
sudo ln -sf /Developer3 /Developer
xcodebuild -parallelizeTargets -alltargets -configuration Deployment && \
sudo ln -sf /Developer4 /Developer
chmod -R go+rX build/Deployment
run: Development
build/Development/iTerm.app/Contents/MacOS/iTerm
devzip: Development
cd build/Development && \
zip -r iTerm2-$(NAME).zip iTerm.app
zip: Deployment
cd build/Deployment && \
zip -r iTerm2-$(NAME).zip iTerm.app
clean:
xcodebuild -parallelizeTargets -alltargets clean
rm -rf build
rm -f *~
backup-old-iterm:
if [[ -d $(APPS)/iTerm.app.bak ]] ; then rm -fr $(APPS)/iTerm.app.bak ; fi
if [[ -d $(APPS)/iTerm.app ]] ; then \
/bin/mv $(APPS)/iTerm.app $(APPS)/iTerm.app.bak ;\
cp $(ITERM_CONF_PLIST) $(APPS)/iTerm.app.bak/Contents/ ; \
fi
restart:
PATH=$(ORIG_PATH) /usr/bin/open /Applications/iTerm.app &
/bin/kill -TERM $(ITERM_PID)
canary:
cp canary-iTerm.plist iTerm.plist
sudo rm /Developer
sudo ln -sf /Developer3 /Developer
make Deployment
sudo ln -sf /Developer4 /Developer
./canary.sh
release:
cp release-iTerm.plist iTerm.plist
sudo ln -sf /Developer3 /Developer
make Deployment
sudo ln -sf /Developer4 /Developer
./release.sh