]> git.saurik.com Git - apple/icu.git/blame - icuSources/config/mh-darwin
ICU-491.11.1.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)
4388f060 4## Copyright (c) 1999-2011 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
12# Pad out the paths to the maximum possible length
13LD_FLAGS += -headerpad_max_install_names
14
15## Commands to generate dependency files
16GEN_DEPS.c= $(CC) -E -MMD $(DEFS) $(CPPFLAGS)
17GEN_DEPS.cc= $(CXX) -E -MMD $(DEFS) $(CPPFLAGS)
18
19## Commands to compile
20COMPILE.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -fno-common -c
21COMPILE.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -fno-common -c
22
23## Commands to make a shared library
729e4ab9
A
24SHLIB.c= $(CC) -dynamiclib -dynamic $(CFLAGS) $(LDFLAGS) $(LD_SOOPTIONS)
25SHLIB.cc= $(CXX) -dynamiclib -dynamic $(CXXFLAGS) $(LDFLAGS) $(LD_SOOPTIONS)
374ca955
A
26
27## Compiler switches to embed a library name and version information
4388f060
A
28ifeq ($(ENABLE_RPATH),YES)
29LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(libdir)/$(notdir $(MIDDLE_SO_TARGET))
30else
374ca955 31LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(notdir $(MIDDLE_SO_TARGET))
4388f060 32endif
b75a7d8f
A
33
34## Compiler switch to embed a runtime search path
35LD_RPATH=
4388f060 36LD_RPATH_PRE= -Wl,-rpath,
b75a7d8f
A
37
38## Environment variable to set a runtime search path
39LDLIBRARYPATH_ENVVAR = DYLD_LIBRARY_PATH
40
374ca955
A
41GENCCODE_ASSEMBLY=-a gcc-darwin
42
b75a7d8f
A
43## Shared object suffix
44SO= dylib
45## Non-shared intermediate object suffix
46STATIC_O = ao
47
46f4442e
A
48## Override Versioned target for a shared library.
49FINAL_SO_TARGET= $(basename $(SO_TARGET)).$(SO_TARGET_VERSION).$(SO)
50MIDDLE_SO_TARGET= $(basename $(SO_TARGET)).$(SO_TARGET_VERSION_MAJOR).$(SO)
51
b75a7d8f
A
52## Compilation rules
53%.$(STATIC_O): $(srcdir)/%.c
54 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
55%.o: $(srcdir)/%.c
56 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
57
58%.$(STATIC_O): $(srcdir)/%.cpp
59 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
60%.o: $(srcdir)/%.cpp
61 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
62
b75a7d8f
A
63
64## Dependency rules
65%.d : $(srcdir)/%.c
66 @echo "generating dependency information for $<"
374ca955 67 @$(GEN_DEPS.c) $< > /dev/null
b75a7d8f 68 @mv $@ $@~
73c04bcf 69 @printf "%s" "$@ " > $@
b75a7d8f
A
70 @cat < $@~ >> $@
71 @-rm $@~
72
73%.d : $(srcdir)/%.cpp
74 @echo "generating dependency information for $<"
374ca955 75 @$(GEN_DEPS.cc) $< >/dev/null
b75a7d8f 76 @mv $@ $@~
73c04bcf 77 @printf "%s" "$@ " > $@
b75a7d8f
A
78 @cat < $@~ >> $@
79 @-rm $@~
80
81## Versioned libraries rules
82
46f4442e 83%.$(SO_TARGET_VERSION_MAJOR).$(SO): %.$(SO_TARGET_VERSION).$(SO)
b75a7d8f 84 $(RM) $@ && ln -s ${<F} $@
46f4442e
A
85%.$(SO): %.$(SO_TARGET_VERSION_MAJOR).$(SO)
86 $(RM) $@ && ln -s ${*F}.$(SO_TARGET_VERSION).$(SO) $@
87
88# tzcode option
89TZORIG_EXTRA_CFLAGS=-DSTD_INSPIRED
90
91# genren opts
92GENREN_PL_OPTS=-x Mach-O -n '-g' -p '| c++filt'
b75a7d8f 93
729e4ab9
A
94## Remove shared library 's'
95STATIC_PREFIX_WHEN_USED =
96STATIC_PREFIX =
97
b75a7d8f 98## End Darwin-specific setup