############################################################################### # Make configuration ############################################################################### .PHONY: depend CPUS = 4 ############################################################################### # Source modules ############################################################################### MODS = main AppDelegate AndAny OtherSourceFiles ThatYou \ RequireFor YourApp ButWithout TheSuffix SRCS = $(addsuffix .m, $(MODS)) OBJS = $(addsuffix .o, $(MODS)) PROGRAM = ProgramName DEPENDS = dependencies.mk ############################################################################### # Program extras ############################################################################### RESOURCES = resources/Info.plist resources/anythingElse.png ############################################################################### # System defines - set IPHONEIP to the iPhone IP address you want to install on # by default. ############################################################################### IPHONEIP = 10.0.1.199 WORKIP = 10.0.1.198 ############################################################################### # Defines for the compiler ############################################################################### OPT = CFLAGS = -I. -std=gnu99 $(OPT) CC =/Developer/SDKs/iPhone/bin/arm-apple-darwin-cc $(CFLAGS) LD =$(CC) LDFLAGS =-ObjC -framework CoreFoundation \ -framework Foundation \ -framework UIKit \ -framework GraphicsServices \ -framework LayerKit \ -framework CoreGraphics \ -larmfp -lsqlite3 LDFLAGS_FRAMEWORKSDIR =-F/Developer/SDKs/iphone/heavenly/System/Library/ ############################################################################### # Targets ############################################################################### all: make -j ${CPUS} depend parallel install parallel: ${PROGRAM} opt: make all OPT=-O ${PROGRAM}: ${OBJS} ${LD} ${LDFLAGS} -o $@ $^ install: $(PROGRAM) rm -rf ${PROGRAM}.app mkdir ${PROGRAM}.app cp ${RESOURCES} ${PROGRAM} ${PROGRAM}.app scp -r ${PROGRAM}.app ${IPHONEIP}:/Applications work: $(PROGRAM) rm -rf ${PROGRAM}.app mkdir ${PROGRAM}.app cp ${RESOURCES} ${PROGRAM} ${PROGRAM}.app scp -r ${PROGRAM}.app root@${WORKIP}:/Applications depend: $(DEPENDS) $(DEPENDS): $(SRCS) gcc -MM -isystem /Developer/SDKs/iPhone/include ${SRCS} > $(DEPENDS) -include $(DEPENDS) ############################################################################### # Rules ############################################################################### %.o: %.m $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ clean: rm -fr *.o $(PROGRAM) ${PROGRAM}.app