1 # No workie: dispatch_sema
2 TESTS= dispatch_apply \
21 dispatch_suspend_timer \
22 dispatch_timer_bit31 \
23 dispatch_timer_bit63 \
24 dispatch_timer_oneshot \
25 dispatch_timer_set_time \
32 all: harness summarize bench $(TESTS)
33 @lipo -remove x86_64 -output dispatch_timer_bit31 dispatch_timer_bit31 2>/dev/null || true
35 logs: $(addsuffix .testlog, $(TESTS))
36 debuglogs: $(addsuffix .debuglog, $(TESTS))
44 _test: all logs debuglogs
45 @cat *.testlog *.debuglog
46 @cat *.testlog *.debuglog | ./summarize
48 # Override ARCHS and SDKROOT to cross-build test suite
50 SRCS = dispatch_test.c
51 OBJS = $(SRCS:%.c=%.o)
53 CFLAGS = -Werror -Wall -Wextra -Wshadow -mdynamic-no-pic -Os -g $(patsubst %, -arch %,$(ARCHS))
55 LDFLAGS = $(patsubst %, -arch %,$(ARCHS))
59 CFLAGS += -isysroot $(SDKROOT)
60 LDFLAGS += -isysroot $(SDKROOT)
61 CC = xcrun -sdk $(SDKROOT) gcc
64 harness: harness.o $(OBJS)
65 summarize: summarize.o
67 $(CC) $(LDFLAGS) -framework Foundation $(LDLIBS) -o $@ $^
70 $(CC) -x objective-c++ $(CFLAGS) -c $^ -o $@
72 $(CC) -x c++ $(CFLAGS) -c $^ -o $@
74 dispatch_apply: dispatch_apply.o $(OBJS)
75 dispatch_api: dispatch_api.o $(OBJS)
76 dispatch_c99: dispatch_c99.o $(OBJS)
77 dispatch_cffd: dispatch_cffd.o $(OBJS)
78 $(CC) $(LDFLAGS) -framework CoreFoundation -o $@ $^
79 dispatch_deadname: dispatch_deadname.o $(OBJS)
80 dispatch_debug: dispatch_debug.o $(OBJS)
81 dispatch_group: dispatch_group.o $(OBJS)
82 dispatch_overcommit: dispatch_overcommit.o $(OBJS)
83 dispatch_pingpong: dispatch_pingpong.o $(OBJS)
84 dispatch_plusplus: dispatch_plusplus.o $(OBJS)
85 dispatch_priority: dispatch_priority.o $(OBJS)
86 dispatch_priority2: dispatch_priority2.o $(OBJS)
87 dispatch_proc: dispatch_proc.o $(OBJS)
88 queue_finalizer: queue_finalizer.o $(OBJS)
89 dispatch_read: dispatch_read.o $(OBJS)
90 dispatch_read2: dispatch_read2.o $(OBJS)
91 dispatch_after: dispatch_after.o $(OBJS)
92 dispatch_timer: dispatch_timer.o $(OBJS)
93 dispatch_suspend_timer: dispatch_suspend_timer.o $(OBJS)
94 dispatch_sema: dispatch_sema.o $(OBJS)
95 dispatch_timer_bit31: dispatch_timer_bit31.o $(OBJS)
96 dispatch_timer_bit63: dispatch_timer_bit63.o $(OBJS)
97 dispatch_timer_oneshot: dispatch_timer_oneshot.o $(OBJS)
98 dispatch_timer_set_time: dispatch_timer_set_time.o $(OBJS)
99 dispatch_drift: dispatch_drift.o $(OBJS)
100 dispatch_starfish: dispatch_starfish.o $(OBJS)
101 dispatch_cascade: dispatch_cascade.o $(OBJS)
102 dispatch_timer_bit31: dispatch_timer_bit31.o $(OBJS)
103 dispatch_readsync: dispatch_readsync.o $(OBJS)
104 ENVIRON_nsoperation = NOLEAKS=1
105 nsoperation: nsoperation.o $(OBJS)
106 $(CC) $(LDFLAGS) -framework Foundation -o $@ $^
108 dispatch_api.o: dispatch_api.c
109 $(CC) -c $(CFLAGS) -include $(SDKROOT)/usr/include/dispatch/dispatch.h -pendantic -o $@ $^
111 dispatch_c99.o: dispatch_c99.c
112 $(CC) -c $(CFLAGS) -std=c99 -pedantic -o $@ $^
114 dispatch_priority2.o: dispatch_priority.c
115 $(CC) -c $(CFLAGS) -DUSE_SET_TARGET_QUEUE=1 -o $@ $^
117 $(addsuffix .testlog, $(TESTS)): harness $(TESTS)
118 $(ENVIRON_$(basename $@)) ./harness ./$(basename $@) > $@
120 $(addsuffix .debuglog, $(TESTS)): harness $(TESTS)
121 $(ENVIRON_$(basename $@)) DYLD_IMAGE_SUFFIX=_debug ./harness ./$(basename $@) > $@
124 rm -f *.testlog *.debuglog *.leakslog
127 rm -f *.o *.dSYM bench harness summarize $(TESTS)