2 Embedded?=$(shell echo $(SDKROOT) | grep -iq iphoneos && echo YES || echo NO)
3 CC:=xcrun -sdk "$(SDKROOT)" cc
4 CFLAGS:=-c -Wall -pedantic
8 SRCROOT?=$(shell /bin/pwd)
9 DSTROOT?=$(shell /bin/pwd)
10 OBJROOT?=$(shell /bin/pwd)
12 SOURCES:=main.c stress_cpu.c stress_memory.c stress_syscall.c stress_fault.c md5.c stress_file_create.c stress_file_write.c stress_file_read.c stress_file_local.c stress_file_ram.c iperf.c compile.c stress_general.c
13 SOURCE_PATHS:=$(addprefix $(SRCROOT)/,$(SOURCES))
14 OBJECTS:=$(addprefix $(OBJROOT)/,$(SOURCES:.c=.o))
21 ifeq "$(Embedded)" "YES"
29 CFLAGS += $(patsubst %, -arch %, $(ARCHS))
30 LDFLAGS += $(patsubst %, -arch %, $(ARCHS))
32 all: $(SOURCE_PATHS) $(EXECUTABLE)
34 $(EXECUTABLE): $(OBJECTS)
35 $(CC) $(LDFLAGS) $(OBJECTS) -o $(DSTROOT)/$@
37 $(OBJROOT)/%.o: $(SRCROOT)/%.c
38 $(CC) $(CFLAGS) $(OPTIMIZATION) $< -o $@