2000-07-03 19:32:00 +00:00
|
|
|
## -*-makefile-*-
|
|
|
|
## Darwin-specific setup (Darwin is the Mac OS X developer preview, successor
|
|
|
|
## to Rhapsody, aka Mac OS X Server)
|
2012-08-03 17:27:44 +00:00
|
|
|
## Copyright (c) 1999-2012 International Business Machines Corporation and
|
2000-07-03 19:32:00 +00:00
|
|
|
## others. All Rights Reserved.
|
|
|
|
|
2000-10-09 19:06:57 +00:00
|
|
|
## Flags for position independent code
|
|
|
|
SHAREDLIBCFLAGS = -dynamic
|
|
|
|
SHAREDLIBCXXFLAGS = -dynamic
|
|
|
|
SHAREDLIBCPPFLAGS =
|
|
|
|
|
2012-08-03 17:27:44 +00:00
|
|
|
# Do not export internal methods by default
|
|
|
|
LIBCFLAGS += -fvisibility=hidden
|
|
|
|
LIBCXXFLAGS += -fvisibility=hidden
|
|
|
|
|
2003-04-24 22:06:46 +00:00
|
|
|
# Pad out the paths to the maximum possible length
|
|
|
|
LD_FLAGS += -headerpad_max_install_names
|
|
|
|
|
2012-08-03 17:27:44 +00:00
|
|
|
# We do not need to see the stderr message that the archive was made.
|
|
|
|
ARFLAGS += -c
|
2000-07-03 19:32:00 +00:00
|
|
|
|
|
|
|
## Commands to compile
|
2000-11-02 22:49:10 +00:00
|
|
|
COMPILE.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -fno-common -c
|
|
|
|
COMPILE.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -fno-common -c
|
2000-07-03 19:32:00 +00:00
|
|
|
|
|
|
|
## Commands to make a shared library
|
2009-07-14 16:50:23 +00:00
|
|
|
SHLIB.c= $(CC) -dynamiclib -dynamic $(CFLAGS) $(LDFLAGS) $(LD_SOOPTIONS)
|
|
|
|
SHLIB.cc= $(CXX) -dynamiclib -dynamic $(CXXFLAGS) $(LDFLAGS) $(LD_SOOPTIONS)
|
2003-10-07 18:36:09 +00:00
|
|
|
|
|
|
|
## Compiler switches to embed a library name and version information
|
2011-07-06 17:08:39 +00:00
|
|
|
ifeq ($(ENABLE_RPATH),YES)
|
|
|
|
LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(libdir)/$(notdir $(MIDDLE_SO_TARGET))
|
|
|
|
else
|
2004-03-26 18:07:36 +00:00
|
|
|
LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(notdir $(MIDDLE_SO_TARGET))
|
2011-07-06 17:08:39 +00:00
|
|
|
endif
|
2000-07-03 19:32:00 +00:00
|
|
|
|
|
|
|
## Compiler switch to embed a runtime search path
|
2002-01-30 02:10:28 +00:00
|
|
|
LD_RPATH=
|
2011-07-06 17:08:39 +00:00
|
|
|
LD_RPATH_PRE= -Wl,-rpath,
|
2000-07-03 19:32:00 +00:00
|
|
|
|
2002-01-25 06:28:45 +00:00
|
|
|
## Environment variable to set a runtime search path
|
|
|
|
LDLIBRARYPATH_ENVVAR = DYLD_LIBRARY_PATH
|
|
|
|
|
2004-03-09 23:36:16 +00:00
|
|
|
GENCCODE_ASSEMBLY=-a gcc-darwin
|
|
|
|
|
2000-07-03 19:32:00 +00:00
|
|
|
## Shared object suffix
|
|
|
|
SO= dylib
|
2000-10-09 19:06:57 +00:00
|
|
|
## Non-shared intermediate object suffix
|
2000-10-09 19:55:52 +00:00
|
|
|
STATIC_O = ao
|
2000-07-03 19:32:00 +00:00
|
|
|
|
2012-08-03 17:27:44 +00:00
|
|
|
# Make sure that both the static and dynamic intermediate objects
|
|
|
|
# get dependency checking
|
|
|
|
ifneq ($(ENABLE_STATIC),)
|
|
|
|
ifneq ($(ENABLE_DYNAMIC),)
|
|
|
|
STATIC_DEPENDENCY_FILE=" $*.$(STATIC_O)"
|
|
|
|
DYNAMIC_DEPENDENCY_FILE=" $*.o"
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2007-07-26 17:08:57 +00:00
|
|
|
## Override Versioned target for a shared library.
|
|
|
|
FINAL_SO_TARGET= $(basename $(SO_TARGET)).$(SO_TARGET_VERSION).$(SO)
|
|
|
|
MIDDLE_SO_TARGET= $(basename $(SO_TARGET)).$(SO_TARGET_VERSION_MAJOR).$(SO)
|
|
|
|
|
2012-08-03 17:27:44 +00:00
|
|
|
## Compilation and dependency rules
|
2000-10-09 19:06:57 +00:00
|
|
|
%.$(STATIC_O): $(srcdir)/%.c
|
2012-08-03 21:10:42 +00:00
|
|
|
$(SILENT_COMPILE)$(strip $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS)) -MMD -MT "$*.d$(DYNAMIC_DEPENDENCY_FILE)" -o $@ $<
|
2000-10-09 19:06:57 +00:00
|
|
|
%.o: $(srcdir)/%.c
|
2012-08-03 21:10:42 +00:00
|
|
|
$(SILENT_COMPILE)$(strip $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS)) -MMD -MT "$*.d$(STATIC_DEPENDENCY_FILE)" -o $@ $<
|
2000-10-09 19:06:57 +00:00
|
|
|
|
|
|
|
%.$(STATIC_O): $(srcdir)/%.cpp
|
2012-08-03 21:10:42 +00:00
|
|
|
$(SILENT_COMPILE)$(strip $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS)) -MMD -MT "$*.d$(DYNAMIC_DEPENDENCY_FILE)" -o $@ $<
|
2000-10-09 19:06:57 +00:00
|
|
|
%.o: $(srcdir)/%.cpp
|
2012-08-03 21:10:42 +00:00
|
|
|
$(SILENT_COMPILE)$(strip $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS)) -MMD -MT "$*.d$(STATIC_DEPENDENCY_FILE)" -o $@ $<
|
2000-07-03 19:32:00 +00:00
|
|
|
|
2002-01-30 02:10:28 +00:00
|
|
|
## Versioned libraries rules
|
|
|
|
|
2007-07-26 17:08:57 +00:00
|
|
|
%.$(SO_TARGET_VERSION_MAJOR).$(SO): %.$(SO_TARGET_VERSION).$(SO)
|
2012-08-08 05:00:02 +00:00
|
|
|
$(RM) $@ && ln -s ${<F} $@
|
2007-07-26 17:08:57 +00:00
|
|
|
%.$(SO): %.$(SO_TARGET_VERSION_MAJOR).$(SO)
|
2012-08-08 05:00:02 +00:00
|
|
|
$(RM) $@ && ln -s ${*F}.$(SO_TARGET_VERSION).$(SO) $@
|
2002-01-30 02:10:28 +00:00
|
|
|
|
2007-08-24 05:22:45 +00:00
|
|
|
# tzcode option
|
|
|
|
TZORIG_EXTRA_CFLAGS=-DSTD_INSPIRED
|
|
|
|
|
2008-05-20 22:59:55 +00:00
|
|
|
# genren opts
|
|
|
|
GENREN_PL_OPTS=-x Mach-O -n '-g' -p '| c++filt'
|
|
|
|
|
2009-08-27 01:19:35 +00:00
|
|
|
## Remove shared library 's'
|
|
|
|
STATIC_PREFIX_WHEN_USED =
|
|
|
|
STATIC_PREFIX =
|
|
|
|
|
2004-03-26 18:07:36 +00:00
|
|
|
## End Darwin-specific setup
|