-SDKROOT ?= /
-ifeq "$(RC_TARGET_CONFIG)" "iPhone"
-Embedded?=YES
-else
-Embedded?=$(shell echo $(SDKROOT) | grep -iq iphoneos && echo YES || echo NO)
-endif
-
-ifdef RC_ARCHS
- ARCHS:=$(RC_ARCHS)
- else
- ifeq "$(Embedded)" "YES"
- ARCHS:=armv7 armv7s arm64
- else
- ARCHS:=x86_64 i386
- endif
-endif
+include ../Makefile.common
CC = $(shell xcrun -sdk "$(SDKROOT)" -find cc)
STRIP = $(shell xcrun -sdk "$(SDKROOT)" -find strip)
CODESIGN = $(shell xcrun -sdk "$(SDKROOT)" -find codesign)
export CODESIGN_ALLOCATE := $(shell xcrun -sdk "$(SDKROOT)" -find codesign_allocate)
DSYMUTIL = $(shell xcrun -sdk "$(SDKROOT)" -find dsymutil)
-CFLAGS = -O0 -g -isysroot $(SDKROOT) $(patsubst %, -arch %,$(ARCHS))
+CFLAGS = -O0 -g -isysroot $(SDKROOT) $(ARCH_FLAGS)
+CFLAGS += -Wl,-sectcreate,__INFO_FILTER,__disable,/dev/null
LDFLAGS = -dead_strip \
- -isysroot $(SDKROOT) $(patsubst %, -arch %,$(ARCHS))
+ -isysroot $(SDKROOT) $(ARCH_FLAGS)
OBJROOT?=$(shell /bin/pwd)/BUILD/obj
SYMROOT?=$(shell /bin/pwd)/BUILD/sym
rm -f $(addprefix $(DSTROOT)/,$(EXECUTABLES))
# DEPENDENCIES
-$(addprefix $(DSTROOT)/,$(EXECUTABLES)): DSTROOT SYMROOT
+$(addprefix $(DSTROOT)/,$(EXECUTABLES)): | DSTROOT SYMROOT
-$(addprefix $(OBJROOT)/,$(OBJECTS)): OBJROOT
+$(addprefix $(OBJROOT)/,$(OBJECTS)): | OBJROOT
DSTROOT SYMROOT OBJROOT:
- mkdir -p $($@)
+ $(_v)mkdir -p $($@)
# OBJECTS
-$(OBJROOT)/exit-asm.o: exit-asm.S OBJROOT
+$(OBJROOT)/exit-asm.o: exit-asm.S | OBJROOT
$(CC) -c -o $@ $< $(CFLAGS)
-$(OBJROOT)/exit.o: exit.c OBJROOT
+$(OBJROOT)/exit.o: exit.c | OBJROOT
$(CC) -c -o $@ $< $(CFLAGS)
-$(OBJROOT)/printexecinfo.o: printexecinfo.c OBJROOT
+$(OBJROOT)/printexecinfo.o: printexecinfo.c | OBJROOT
$(CC) -c -o $@ $< $(CFLAGS)
-$(OBJROOT)/run.o: run.c OBJROOT
+$(OBJROOT)/run.o: run.c | OBJROOT
$(CC) -c -o $@ $< $(CFLAGS)
# EXECUTABLES