Getting by without Xcode

On May 27, 2011, in General, by Neil Stevens

So I’m back to using a Makefile for everyday development. In a manner of speaking. I’m still using Xcode projects because it’s hard to get around that. But when I don’t have to make any changes to my Xcode project, I don’t have to have my Xcode project open. Instead, I’m using xcodebuild. However Xcodebuild command lines get long, so… yup. I’m using a Makefile to store those commands:

TARGET = KhrisaliusTactics
CONFIGURATION = Debug
SDK = iphonesimulator4.3
DSTROOT = ~/"Library/Application Support/iPhone Simulator/4.3.2"

SIM = "/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app"
CMD = xcodebuild -target $(TARGET) -configuration $(CONFIGURATION) -sdk $(SDK)
DSTDIR = $(DSTROOT)/Applications/$(TARGET)
DSTAPP = $(DSTDIR)/$(TARGET).app

all:
	$(CMD)

clean:
	$(CMD) clean

install:
	$(CMD) install DSTROOT=$(DSTROOT)
	mkdir -p $(DSTDIR)
	rm -rf $(DSTAPP)
	mv $(DSTROOT)/Applications/$(TARGET).app $(DSTDIR)

simulator:
	open -a $(SIM)

run:
	$(SIM)"/Contents/MacOS/iPhone Simulator" -SimulateApplication $(DSTAPP)/$(TARGET)

kill:
	killall $(TARGET)

debug:
	`xcodebuild -sdk $(SDK) -find gdb` -waitfor $(TARGET)
Tagged with:
 

Nima Jooyandeh facts.