]> git.saurik.com Git - apple/icu.git/blame - icuSources/config/mh-darwin
ICU-511.25.tar.gz
[apple/icu.git] / icuSources / config / mh-darwin
CommitLineData
b75a7d8f
A
1## -*-makefile-*-
2## Darwin-specific setup (Darwin is the Mac OS X developer preview, successor
3## to Rhapsody, aka Mac OS X Server)
51004dcb 4## Copyright (c) 1999-2012 International Business Machines Corporation and
b75a7d8f 5## others. All Rights Reserved.
b75a7d8f
A
6
7## Flags for position independent code
8SHAREDLIBCFLAGS = -dynamic
9SHAREDLIBCXXFLAGS = -dynamic
10SHAREDLIBCPPFLAGS =
11
51004dcb
A
12# Do not export internal methods by default
13LIBCFLAGS += -fvisibility=hidden
14LIBCXXFLAGS += -fvisibility=hidden
15
b75a7d8f
A
16# Pad out the paths to the maximum possible length
17LD_FLAGS += -headerpad_max_install_names
18
51004dcb
A
19# We do not need to see the stderr message that the archive was made.
20ARFLAGS += -c
b75a7d8f
A
21
22## Commands to compile
23COMPILE.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -fno-common -c
24COMPILE.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -fno-common -c
25
26## Commands to make a shared library
729e4ab9
A
27SHLIB.c= $(CC) -dynamiclib -dynamic $(CFLAGS) $(LDFLAGS) $(LD_SOOPTIONS)
28SHLIB.cc= $(CXX) -dynamiclib -dynamic $(CXXFLAGS) $(LDFLAGS) $(LD_SOOPTIONS)
374ca955
A
29
30## Compiler switches to embed a library name and version information
4388f060
A
31ifeq ($(ENABLE_RPATH),YES)
32LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(libdir)/$(notdir $(MIDDLE_SO_TARGET))
33else
374ca955 34LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(notdir $(MIDDLE_SO_TARGET))
4388f060 35endif
b75a7d8f
A
36
37## Compiler switch to embed a runtime search path
38LD_RPATH=
4388f060 39LD_RPATH_PRE= -Wl,-rpath,
b75a7d8f
A
40
41## Environment variable to set a runtime search path
42LDLIBRARYPATH_ENVVAR = DYLD_LIBRARY_PATH
43
374ca955
A
44GENCCODE_ASSEMBLY=-a gcc-darwin
45
b75a7d8f
A
46## Shared object suffix
47SO= dylib
48## Non-shared intermediate object suffix
49STATIC_O = ao
50
46f4442e
A
51## Override Versioned target for a shared library.
52FINAL_SO_TARGET= $(basename $(SO_TARGET)).$(SO_TARGET_VERSION).$(SO)
53MIDDLE_SO_TARGET= $(basename $(SO_TARGET)).$(SO_TARGET_VERSION_MAJOR).$(SO)
54
51004dcb 55## Compilation and dependency rules
b75a7d8f 56%.$(STATIC_O): $(srcdir)/%.c
51004dcb 57 $(call SILENT_COMPILE,$(strip $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS)) -MMD -MT "$*.d $*.o $*.$(STATIC_O)" -o $@ $<)
b75a7d8f 58%.o: $(srcdir)/%.c
51004dcb 59 $(call SILENT_COMPILE,$(strip $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS)) -MMD -MT "$*.d $*.o $*.$(STATIC_O)" -o $@ $<)
b75a7d8f
A
60
61%.$(STATIC_O): $(srcdir)/%.cpp
51004dcb 62 $(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS)) -MMD -MT "$*.d $*.o $*.$(STATIC_O)" -o $@ $<)
b75a7d8f 63%.o: $(srcdir)/%.cpp
51004dcb 64 $(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS)) -MMD -MT "$*.d $*.o $*.$(STATIC_O)" -o $@ $<)
b75a7d8f
A
65
66## Versioned libraries rules
67
46f4442e 68%.$(SO_TARGET_VERSION_MAJOR).$(SO): %.$(SO_TARGET_VERSION).$(SO)
b75a7d8f 69 $(RM) $@ && ln -s ${<F} $@
46f4442e
A
70%.$(SO): %.$(SO_TARGET_VERSION_MAJOR).$(SO)
71 $(RM) $@ && ln -s ${*F}.$(SO_TARGET_VERSION).$(SO) $@
72
73# tzcode option
74TZORIG_EXTRA_CFLAGS=-DSTD_INSPIRED
75
76# genren opts
77GENREN_PL_OPTS=-x Mach-O -n '-g' -p '| c++filt'
b75a7d8f 78
729e4ab9
A
79## Remove shared library 's'
80STATIC_PREFIX_WHEN_USED =
81STATIC_PREFIX =
82
b75a7d8f 83## End Darwin-specific setup