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