[原]iOS Makefile Template

export DEVELOPER_DIR := $(shell xcode-select --print-path)
PLATFORM="$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform"
SDK_DEVICE="$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk"
SDK_SIMULATOR="$(DEVELOPER_DIR)/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneOS7.0.sdk"
CC=xcrun -sdk "iphoneos" gcc

all: main.c
    $(CC) -o main main.c -arch armv7 -miphoneos-version-min=5.0 -isysroot $(SDK_DEVICE) -I$(SDK_DEVICE)/usr/include -I.

clean:
    rm main

 

export DEVELOPER_DIR := $(shell xcode-select --print-path)
PLATFORM="$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform"
SDK_DEVICE="$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk"
SDK_SIMULATOR="$(DEVELOPER_DIR)/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneOS7.0.sdk"
CC=xcrun -sdk "iphoneos" gcc

all: syscall.o launchd.o
    $(CC) -o launchd launchd.o syscalls.o -arch armv7 -static -fno-stack-protector -nostartfiles -nodefaultlibs -nostdlib -Wl,-e,_main

syscall.o: syscalls.S
    $(CC) -c syscalls.S -o syscalls.o -arch armv7 -fno-stack-protector
    
launchd.o: launchd.c
    $(CC) -c launchd.c -o launchd.o -arch armv7 -fno-stack-protector -isysroot $(SDK_DEVICE) -I$(SDK_DEVICE)/usr/include -I.

codesign:
    ldid -S launchd

clean:
    rm launchd syscall.o launchd.o

 

posted @ 2014-04-09 11:14  Proteas  阅读(503)  评论(0编辑  收藏  举报