6 swiftlibdir=${prefix}/lib/swift/linux
7 swiftlib_LTLIBRARIES=libdispatch.la
9 lib_LTLIBRARIES=libdispatch.la
12 libdispatch_la_SOURCES= \
30 allocator_internal.h \
34 introspection_internal.h \
38 semaphore_internal.h \
43 firehose/firehose_internal.h \
57 EXTRA_libdispatch_la_SOURCES=
58 EXTRA_libdispatch_la_DEPENDENCIES=
60 AM_CPPFLAGS=-I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/private
62 DISPATCH_CFLAGS=-Wall $(VISIBILITY_FLAGS) $(OMIT_LEAF_FP_FLAGS) \
63 $(MARCH_FLAGS) $(KQUEUE_CFLAGS) $(BSD_OVERLAY_CFLAGS)
64 AM_CFLAGS= $(PTHREAD_WORKQUEUE_CFLAGS) $(DISPATCH_CFLAGS) $(CBLOCKS_FLAGS)
65 AM_OBJCFLAGS=$(DISPATCH_CFLAGS) $(CBLOCKS_FLAGS)
66 AM_CXXFLAGS=$(PTHREAD_WORKQUEUE_CFLAGS) $(DISPATCH_CFLAGS) $(CXXBLOCKS_FLAGS)
67 AM_OBJCXXFLAGS=$(DISPATCH_CFLAGS) $(CXXBLOCKS_FLAGS)
69 if BUILD_OWN_PTHREAD_WORKQUEUES
70 PTHREAD_WORKQUEUE_LIBS=$(top_builddir)/libpwq/libpthread_workqueue.la
71 PTHREAD_WORKQUEUE_CFLAGS=-I$(top_srcdir)/libpwq/include
73 if HAVE_PTHREAD_WORKQUEUES
74 PTHREAD_WORKQUEUE_LIBS=-lpthread_workqueue
78 libdispatch_la_LDFLAGS=-avoid-version
79 libdispatch_la_LIBADD=$(KQUEUE_LIBS) $(PTHREAD_WORKQUEUE_LIBS) $(BSD_OVERLAY_LIBS)
82 libdispatch_la_LDFLAGS+=-Wl,-compatibility_version,1 \
83 -Wl,-current_version,$(VERSION) -Wl,-dead_strip \
84 -Wl,-alias_list,$(top_srcdir)/xcodeconfig/libdispatch.aliases
88 libdispatch_la_LDFLAGS+=-Xcompiler -fuse-ld=gold
92 libdispatch_la_SOURCES+=block.cpp data.m object.m
93 libdispatch_la_OBJCFLAGS=$(AM_OBJCFLAGS) -Wno-switch -fobjc-gc
94 libdispatch_la_CXXFLAGS=$(AM_CXXFLAGS) -std=gnu++11 -fno-exceptions
95 libdispatch_la_LDFLAGS+=-Wl,-upward-lobjc -Wl,-upward-lauto \
96 -Wl,-order_file,$(top_srcdir)/xcodeconfig/libdispatch.order
98 libdispatch_la_SOURCES+=block.cpp
99 libdispatch_la_CXXFLAGS=$(AM_CXXFLAGS) -std=gnu++11 -fno-exceptions
109 %User.c %.h %Server.c %Server.h: $(abs_srcdir)/%.defs
110 $(MIG) -user $*User.c -header $*.h \
111 -server $*Server.c -sheader $*Server.h $<
115 DTRACE_SOURCES=provider.h
117 %.h: $(abs_srcdir)/%.d
118 $(DTRACE) -h -s $< -o $@
125 swift/Dispatch.swift \
127 swift/Private.swift \
133 SWIFT_ABS_SRC_FILES = $(SWIFT_SRC_FILES:%=$(abs_srcdir)/%)
134 SWIFT_OBJ_FILES = $(SWIFT_SRC_FILES:%.swift=$(abs_builddir)/%.o)
136 libdispatch_la_SOURCES+=swift/DispatchStubs.cc
137 EXTRA_libdispatch_la_SOURCES+=$(SWIFT_SRC_FILES)
139 EXTRA_libdispatch_la_DEPENDENCIES+=$(SWIFT_OBJ_FILES) $(abs_builddir)/swift/Dispatch.swiftmodule
140 libdispatch_la_LIBADD+=$(SWIFT_OBJ_FILES)
143 $(abs_builddir)/swift/Dispatch.swiftmodule \
144 $(abs_builddir)/swift/Dispatch.swiftdoc \
146 $(SWIFT_OBJ_FILES:%=%.d) \
147 $(SWIFT_OBJ_FILES:%=%.swiftdeps) \
148 $(SWIFT_OBJ_FILES:%=%.~partial.swiftmodule) \
149 $(SWIFT_OBJ_FILES:%=%.~partial.swiftdoc) \
150 $(SWIFT_OBJ_FILES:%=%.~partial.swiftdeps)
152 SWIFTC_FLAGS = -Xcc -fmodule-map-file=$(abs_top_srcdir)/dispatch/module.map -I$(abs_top_srcdir) -Xcc -fblocks
154 $(abs_builddir)/swift/%.o: $(abs_srcdir)/swift/%.swift
155 $(SWIFTC) -frontend -c $(SWIFT_ABS_SRC_FILES) -primary-file $< \
156 $(SWIFTC_FLAGS) -module-name Dispatch -module-link-name dispatch \
157 -o $@ -emit-module-path $@.~partial.swiftmodule \
158 -emit-module-doc-path $@.~partial.swiftdoc -emit-dependencies-path $@.d \
159 -emit-reference-dependencies-path $@.swiftdeps \
160 -module-cache-path $(top_builddir)
162 $(abs_builddir)/swift/Dispatch.swiftmodule: $(SWIFT_ABS_SRC_FILES)
163 $(SWIFTC) -frontend -emit-module $(SWIFT_OBJ_FILES:%=%.~partial.swiftmodule) \
164 $(SWIFTC_FLAGS) -module-cache-path $(top_builddir) -module-link-name dispatch \
165 -o $@ -emit-module-doc-path $(@:%.swiftmodule=%.swiftdoc)
167 swiftmoddir=${prefix}/lib/swift/linux/${build_cpu}
169 $(abs_builddir)/swift/Dispatch.swiftmodule \
170 $(abs_builddir)/swift/Dispatch.swiftdoc
174 BUILT_SOURCES=$(MIG_SOURCES) $(DTRACE_SOURCES)
175 nodist_libdispatch_la_SOURCES=$(BUILT_SOURCES)
176 CLEANFILES=$(BUILT_SOURCES) $(SWIFT_GEN_FILES)
177 DISTCLEANFILES=pthread_machdep.h pthread System mach objc