blob: 31850f78f981557c691623e7d04e007586aaba49 [file] [log] [blame]
Daniel Dunbar78cfbc52010-01-18 06:48:56 +00001# compiler-rt Library Info
2#
3# This should be included once the subdirectory information has been loaded, and
4# uses the utilities in 'util.mk'.
5#
6# This defines the following variables describing compiler-rt:
7# AvailableFunctions - The entire list of function names (unmangled) the
8# library can provide.
9# CommonFunctions - The list of generic functions available.
10# ArchFunctions.<arch> - The list of functions commonly available for
11# 'arch'. This does not include any config specific
12# functions.
13#
14# AvailableIn.<function> - The list of subdir keys where 'function' is
15# defined.
16
Daniel Dunbarf06648a2011-12-02 02:42:07 +000017# Determine the set of available modules.
18AvailableModules := $(sort $(foreach key,$(SubDirKeys),\
19 $($(key).ModuleName)))
20
21# Build a per-module map of subdir keys.
22$(foreach key,$(SubDirKeys),\
23 $(call Append,ModuleSubDirKeys.$($(key).ModuleName),$(key)))
24
Daniel Dunbar78cfbc52010-01-18 06:48:56 +000025AvailableArchs := $(sort $(foreach key,$(SubDirKeys),\
26 $($(key).OnlyArchs)))
27
28AvailableFunctions := $(sort $(foreach key,$(SubDirKeys),\
29 $(basename $($(key).ObjNames))))
30
31CommonFunctions := $(sort\
Daniel Dunbarf06648a2011-12-02 02:42:07 +000032 $(foreach key,$(ModuleSubDirKeys.builtins),\
Daniel Dunbar78cfbc52010-01-18 06:48:56 +000033 $(if $(call strneq,,$(strip $($(key).OnlyArchs) $($(key).OnlyConfigs))),,\
34 $(basename $($(key).ObjNames)))))
35
36# Compute common arch functions.
Daniel Dunbarf06648a2011-12-02 02:42:07 +000037$(foreach key,$(ModuleSubDirKeys.builtins),\
Daniel Dunbar78cfbc52010-01-18 06:48:56 +000038 $(if $(call strneq,,$($(key).OnlyConfigs)),,\
39 $(foreach arch,$($(key).OnlyArchs),\
40 $(call Append,ArchFunctions.$(arch),$(sort \
41 $(basename $($(key).ObjNames)))))))
42
43# Compute arch only functions.
44$(foreach arch,$(AvailableArchs),\
45 $(call Set,ArchFunctions.$(arch),$(sort $(ArchFunctions.$(arch))))\
46 $(call Set,ArchOnlyFunctions.$(arch),\
47 $(call set_difference,$(ArchFunctions.$(arch)),$(CommonFunctions))))
48
49# Compute lists of where each function is available.
50$(foreach key,$(SubDirKeys),\
51 $(foreach fn,$(basename $($(key).ObjNames)),\
52 $(call Append,AvailableIn.$(fn),$(key))))
Daniel Dunbar48464e02010-01-18 06:49:33 +000053
54# The names of all the available options.
55AvailableOptions := AR ARFLAGS \
Daniel Dunbar8bc01cb2012-09-07 19:57:23 +000056 CC CFLAGS LDFLAGS FUNCTIONS OPTIMIZED \
Daniel Dunbar6a571fb2010-01-18 22:19:34 +000057 RANLIB RANLIBFLAGS \
Daniel Dunbar8bc01cb2012-09-07 19:57:23 +000058 VISIBILITY_HIDDEN KERNEL_USE \
Nick Kledzikc0973d62012-11-26 22:48:51 +000059 SHARED_LIBRARY SHARED_LIBRARY_SUFFIX STRIP LIPO DSYMUTIL