2 ## Darwin-specific setup (Darwin is the Mac OS X developer preview, successor
3 ## to Rhapsody, aka Mac OS X Server)
4 ## Copyright (c) 1999-2009 International Business Machines Corporation and
5 ## others. All Rights Reserved.
7 ## Flags for position independent code
8 SHAREDLIBCFLAGS = -dynamic
9 SHAREDLIBCXXFLAGS = -dynamic
12 # Pad out the paths to the maximum possible length
13 LD_FLAGS += -headerpad_max_install_names
15 ## Commands to generate dependency files
16 GEN_DEPS.c= $(CC) -E -MMD $(DEFS) $(CPPFLAGS)
17 GEN_DEPS.cc= $(CXX) -E -MMD $(DEFS) $(CPPFLAGS)
19 ## Commands to compile
20 COMPILE.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -fno-common -c
21 COMPILE.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -fno-common -c
23 ## Commands to make a shared library
24 SHLIB.c= $(CC) -dynamiclib -dynamic $(CFLAGS) $(LDFLAGS) $(LD_SOOPTIONS)
25 SHLIB.cc= $(CXX) -dynamiclib -dynamic $(CXXFLAGS) $(LDFLAGS) $(LD_SOOPTIONS)
27 ## Compiler switches to embed a library name and version information
28 LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(notdir $(MIDDLE_SO_TARGET))
30 ## Compiler switch to embed a runtime search path
34 ## Environment variable to set a runtime search path
35 LDLIBRARYPATH_ENVVAR = DYLD_LIBRARY_PATH
37 GENCCODE_ASSEMBLY=-a gcc-darwin
39 ## Shared object suffix
41 ## Non-shared intermediate object suffix
44 ## Override Versioned target for a shared library.
45 FINAL_SO_TARGET= $(basename $(SO_TARGET)).$(SO_TARGET_VERSION).$(SO)
46 MIDDLE_SO_TARGET= $(basename $(SO_TARGET)).$(SO_TARGET_VERSION_MAJOR).$(SO)
49 %.$(STATIC_O): $(srcdir)/%.c
50 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
52 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
54 %.$(STATIC_O): $(srcdir)/%.cpp
55 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
57 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
62 @echo "generating dependency information for $<"
63 @$(GEN_DEPS.c) $< > /dev/null
65 @printf "%s" "$@ " > $@
70 @echo "generating dependency information for $<"
71 @$(GEN_DEPS.cc) $< >/dev/null
73 @printf "%s" "$@ " > $@
77 ## Versioned libraries rules
79 %.$(SO_TARGET_VERSION_MAJOR).$(SO): %.$(SO_TARGET_VERSION).$(SO)
80 $(RM) $@ && ln -s ${<F} $@
81 %.$(SO): %.$(SO_TARGET_VERSION_MAJOR).$(SO)
82 $(RM) $@ && ln -s ${*F}.$(SO_TARGET_VERSION).$(SO) $@
85 TZORIG_EXTRA_CFLAGS=-DSTD_INSPIRED
88 GENREN_PL_OPTS=-x Mach-O -n '-g' -p '| c++filt'
90 ## Remove shared library 's'
91 STATIC_PREFIX_WHEN_USED =
94 ## End Darwin-specific setup