michael@0: ## -*-makefile-*- michael@0: ## Darwin-specific setup (Darwin is the Mac OS X developer preview, successor michael@0: ## to Rhapsody, aka Mac OS X Server) michael@0: ## Copyright (c) 1999-2012 International Business Machines Corporation and michael@0: ## others. All Rights Reserved. michael@0: michael@0: ## Flags for position independent code michael@0: SHAREDLIBCFLAGS = -dynamic michael@0: SHAREDLIBCXXFLAGS = -dynamic michael@0: SHAREDLIBCPPFLAGS = michael@0: michael@0: # Do not export internal methods by default michael@0: LIBCFLAGS += -fvisibility=hidden michael@0: LIBCXXFLAGS += -fvisibility=hidden michael@0: michael@0: # Pad out the paths to the maximum possible length michael@0: LD_FLAGS += -headerpad_max_install_names michael@0: michael@0: # We do not need to see the stderr message that the archive was made. michael@0: ARFLAGS += -c michael@0: michael@0: ## Commands to compile michael@0: COMPILE.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -fno-common -c michael@0: COMPILE.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -fno-common -c michael@0: michael@0: ## Commands to make a shared library michael@0: SHLIB.c= $(CC) -dynamiclib -dynamic $(CFLAGS) $(LDFLAGS) $(LD_SOOPTIONS) michael@0: SHLIB.cc= $(CXX) -dynamiclib -dynamic $(CXXFLAGS) $(LDFLAGS) $(LD_SOOPTIONS) michael@0: michael@0: ## Compiler switches to embed a library name and version information michael@0: LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name @executable_path/$(notdir $(MIDDLE_SO_TARGET)) michael@0: michael@0: ## Compiler switch to embed a runtime search path michael@0: LD_RPATH= michael@0: LD_RPATH_PRE= -Wl,-rpath, michael@0: michael@0: ## Environment variable to set a runtime search path michael@0: LDLIBRARYPATH_ENVVAR = DYLD_LIBRARY_PATH michael@0: michael@0: GENCCODE_ASSEMBLY=-a gcc-darwin michael@0: michael@0: ## Shared object suffix michael@0: SO= dylib michael@0: ## Non-shared intermediate object suffix michael@0: STATIC_O = ao michael@0: michael@0: ## Override Versioned target for a shared library. michael@0: FINAL_SO_TARGET= $(basename $(SO_TARGET)).$(SO_TARGET_VERSION).$(SO) michael@0: MIDDLE_SO_TARGET= $(basename $(SO_TARGET)).$(SO_TARGET_VERSION_MAJOR).$(SO) michael@0: michael@0: ## Compilation and dependency rules michael@0: %.$(STATIC_O): $(srcdir)/%.c michael@0: $(call SILENT_COMPILE,$(strip $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS)) -MMD -MT "$*.d $*.o $*.$(STATIC_O)" -o $@ $<) michael@0: %.o: $(srcdir)/%.c michael@0: $(call SILENT_COMPILE,$(strip $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS)) -MMD -MT "$*.d $*.o $*.$(STATIC_O)" -o $@ $<) michael@0: michael@0: %.$(STATIC_O): $(srcdir)/%.cpp michael@0: $(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS)) -MMD -MT "$*.d $*.o $*.$(STATIC_O)" -o $@ $<) michael@0: %.o: $(srcdir)/%.cpp michael@0: $(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS)) -MMD -MT "$*.d $*.o $*.$(STATIC_O)" -o $@ $<) michael@0: michael@0: ## Versioned libraries rules michael@0: michael@0: %.$(SO_TARGET_VERSION_MAJOR).$(SO): %.$(SO_TARGET_VERSION).$(SO) michael@0: $(RM) $@ && ln -s ${