]> git.saurik.com Git - apple/xnu.git/blame - tools/tests/perf_index/Makefile
xnu-2422.115.4.tar.gz
[apple/xnu.git] / tools / tests / perf_index / Makefile
CommitLineData
39236c6e
A
1SDKROOT ?= /
2Embedded?=$(shell echo $(SDKROOT) | grep -iq iphoneos && echo YES || echo NO)
3CC:=xcrun -sdk "$(SDKROOT)" cc
4CFLAGS:=-c -Wall -pedantic
5OPTIMIZATION:=-Os
6LDFLAGS=
7
8SRCROOT?=$(shell /bin/pwd)
9DSTROOT?=$(shell /bin/pwd)
10OBJROOT?=$(shell /bin/pwd)
11
12SOURCES:=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
13SOURCE_PATHS:=$(addprefix $(SRCROOT)/,$(SOURCES))
14OBJECTS:=$(addprefix $(OBJROOT)/,$(SOURCES:.c=.o))
15EXECUTABLE=perf_index
16
17ifdef RC_ARCHS
18ARCHS:=$(RC_ARCHS)
19else
20ifeq ($(ARCHS),)
21ifeq "$(Embedded)" "YES"
22ARCHS:=armv7 armv7s
23else
24ARCHS:=x86_64 i386
25endif
26endif
27endif
28
29CFLAGS += $(patsubst %, -arch %, $(ARCHS))
30LDFLAGS += $(patsubst %, -arch %, $(ARCHS))
31
32all: $(SOURCE_PATHS) $(EXECUTABLE)
33
34$(EXECUTABLE): $(OBJECTS)
35 $(CC) $(LDFLAGS) $(OBJECTS) -o $(DSTROOT)/$@
36
37$(OBJROOT)/%.o: $(SRCROOT)/%.c
38 $(CC) $(CFLAGS) $(OPTIMIZATION) $< -o $@
39
40clean:
41 rm -f *.o
42 rm -f $(EXECUTABLE)