1LD_EXTRAS := -L. -lloadunload_d 2CXX_SOURCES := main.cpp 3USE_LIBDL := 1 4 5a.out: lib_b lib_a lib_c lib_d hidden_lib_d 6 7include Makefile.rules 8 9lib_a: lib_b 10 $(MAKE) -f $(MAKEFILE_RULES) \ 11 DYLIB_ONLY=YES DYLIB_CXX_SOURCES=a.cpp DYLIB_NAME=loadunload_a \ 12 LD_EXTRAS="-L. -lloadunload_b" 13 14lib_b: 15 $(MAKE) -f $(MAKEFILE_RULES) \ 16 DYLIB_ONLY=YES DYLIB_CXX_SOURCES=b.cpp DYLIB_NAME=loadunload_b 17 18lib_c: 19 $(MAKE) -f $(MAKEFILE_RULES) \ 20 DYLIB_ONLY=YES DYLIB_CXX_SOURCES=c.cpp DYLIB_NAME=loadunload_c 21 22lib_d: 23 $(MAKE) -f $(MAKEFILE_RULES) \ 24 DYLIB_ONLY=YES DYLIB_CXX_SOURCES=d.cpp DYLIB_NAME=loadunload_d 25ifeq ($(OS),Darwin) 26 install_name_tool -id @executable_path/libloadunload_d.dylib libloadunload_d.dylib 27endif 28 29hidden_lib_d: hidden 30 $(MAKE) VPATH=$(SRCDIR)/hidden -C hidden -f $(MAKEFILE_RULES) \ 31 DYLIB_ONLY=YES DYLIB_CXX_SOURCES=d.cpp DYLIB_NAME=loadunload_d 32