xref: /llvm-project/lldb/test/API/functionalities/load_lazy/Makefile (revision 3ef630ac339f31686290f9460a40eb2a9c9f5bd0)
1CXX_SOURCES := main.cpp
2USE_LIBDL := 1
3
4all: t2_0 t2_1 t1 a.out
5
6include Makefile.rules
7
8ifeq "$(OS)" "Darwin"
9	# In macOS 12, dyld switched to using chained fixups. As a result, all
10	# symbols are bound at launch and there are no lazy pointers any more.
11	# Since we wish to import/dlopen() a dylib with missing symbols, we need
12	# to use a weak import. This applies to all macOS 12-aligned OS releases,
13	# e.g. iOS 15, etc.
14	LINKFLAGS := "-Wl,-weak-lt2_0"
15else
16	LINKFLAGS := "-lt2_0"
17endif
18
19t1: t2_0
20	"$(MAKE)" VPATH=$(SRCDIR) -f $(MAKEFILE_RULES) \
21		DYLIB_ONLY=YES DYLIB_C_SOURCES=t1.c DYLIB_NAME=t1 LD_EXTRAS="-L. $(LINKFLAGS)"
22
23t2_0:
24	"$(MAKE)" VPATH=$(SRCDIR) -f $(MAKEFILE_RULES) \
25		DYLIB_ONLY=YES DYLIB_C_SOURCES=t2_0.c DYLIB_NAME=t2_0
26
27t2_1:
28	"$(MAKE)" VPATH=$(SRCDIR) -f $(MAKEFILE_RULES) \
29		DYLIB_ONLY=YES DYLIB_C_SOURCES=t2_1.c DYLIB_NAME=t2_1
30