1 # No workie: dispatch_sema
3 MAKECMD= $(MAKE) -f Makefile.darwin
5 TESTS= dispatch_apply \
20 dispatch_timer_bit31 \
21 dispatch_timer_bit63 \
28 all: harness summarize bench $(TESTS)
29 @lipo -remove x86_64 -output dispatch_timer_bit31 dispatch_timer_bit31 2>/dev/null || true
31 logs: $(addsuffix .testlog, $(TESTS))
32 debuglogs: $(addsuffix .debuglog, $(TESTS))
40 _test: all logs debuglogs
41 @cat *.testlog *.debuglog
42 @cat *.testlog *.debuglog | ./summarize
44 # Override ARCHS and SDKROOT to cross-build test suite
46 SRCS = dispatch_test.c
47 OBJS = $(SRCS:%.c=%.o)
49 CFLAGS = -Werror -Wall -Wextra -Wshadow -mdynamic-no-pic -Os -g $(patsubst %, -arch %,$(ARCHS)) -DDISPATCH_NO_LEGACY -I..
51 LDFLAGS = $(patsubst %, -arch %,$(ARCHS))
55 CFLAGS += -isysroot $(SDKROOT)
56 LDFLAGS += -isysroot $(SDKROOT)
57 CC = xcrun -sdk $(SDKROOT) gcc
60 harness: harness.o $(OBJS)
61 summarize: summarize.o
63 $(CC) $(LDFLAGS) -framework Foundation $(LDLIBS) -o $@ $^
66 $(CC) -x objective-c++ $(CFLAGS) -c $^ -o $@
68 $(CC) -x c++ $(CFLAGS) -c $^ -o $@
70 dispatch_apply: dispatch_apply.o $(OBJS)
71 dispatch_api: dispatch_api.o $(OBJS)
72 dispatch_c99: dispatch_c99.o $(OBJS)
73 dispatch_cffd: dispatch_cffd.o $(OBJS)
74 $(CC) $(LDFLAGS) -framework CoreFoundation -o $@ $^
75 dispatch_debug: dispatch_debug.o $(OBJS)
76 dispatch_group: dispatch_group.o $(OBJS)
77 dispatch_pingpong: dispatch_pingpong.o $(OBJS)
78 dispatch_plusplus: dispatch_plusplus.o $(OBJS)
79 dispatch_priority: dispatch_priority.o $(OBJS)
80 dispatch_priority2: dispatch_priority2.o $(OBJS)
81 dispatch_proc: dispatch_proc.o $(OBJS)
82 queue_finalizer: queue_finalizer.o $(OBJS)
83 dispatch_read: dispatch_read.o $(OBJS)
84 dispatch_read2: dispatch_read2.o $(OBJS)
85 dispatch_after: dispatch_after.o $(OBJS)
86 dispatch_timer: dispatch_timer.o $(OBJS)
87 dispatch_suspend_timer: dispatch_suspend_timer.o $(OBJS)
88 dispatch_sema: dispatch_sema.o $(OBJS)
89 dispatch_timer_bit31: dispatch_timer_bit31.o $(OBJS)
90 dispatch_timer_bit63: dispatch_timer_bit63.o $(OBJS)
91 dispatch_drift: dispatch_drift.o $(OBJS)
92 dispatch_starfish: dispatch_starfish.o $(OBJS)
93 dispatch_cascade: dispatch_cascade.o $(OBJS)
94 dispatch_readsync: dispatch_readsync.o $(OBJS)
95 ENVIRON_nsoperation = NOLEAKS=1
96 nsoperation: nsoperation.o $(OBJS)
97 $(CC) $(LDFLAGS) -framework Foundation -o $@ $^
99 dispatch_api.o: dispatch_api.c
100 $(CC) -c $(CFLAGS) -include $(SDKROOT)/usr/include/dispatch/dispatch.h -pendantic -o $@ $^
102 dispatch_c99.o: dispatch_c99.c
103 $(CC) -c $(CFLAGS) -std=c99 -pedantic -o $@ $^
105 dispatch_priority2.o: dispatch_priority.c
106 $(CC) -c $(CFLAGS) -DUSE_SET_TARGET_QUEUE=1 -o $@ $^
108 $(addsuffix .testlog, $(TESTS)): harness $(TESTS)
109 $(ENVIRON_$(basename $@)) ./harness ./$(basename $@) > $@
111 $(addsuffix .debuglog, $(TESTS)): harness $(TESTS)
112 $(ENVIRON_$(basename $@)) DYLD_IMAGE_SUFFIX=_debug ./harness ./$(basename $@) > $@
115 rm -f *.testlog *.debuglog *.leakslog
118 rm -f *.o *.dSYM bench harness summarize $(TESTS)