]> git.saurik.com Git - apple/icu.git/blob - icuSources/config/mh-darwin
ICU-3.13.tar.gz
[apple/icu.git] / icuSources / config / mh-darwin
1 ## -*-makefile-*-
2 ## Darwin-specific setup (Darwin is the Mac OS X developer preview, successor
3 ## to Rhapsody, aka Mac OS X Server)
4 ## Copyright (c) 1999-2003, International Business Machines Corporation and
5 ## others. All Rights Reserved.
6 ##
7 ## $Id: mh-darwin,v 1.6 2003/07/03 23:51:33 avery Exp $
8
9 ## Flags for position independent code
10 SHAREDLIBCFLAGS = -dynamic
11 SHAREDLIBCXXFLAGS = -dynamic
12 SHAREDLIBCPPFLAGS =
13
14 # Pad out the paths to the maximum possible length
15 LD_FLAGS += -headerpad_max_install_names
16
17 ## Commands to generate dependency files
18 GEN_DEPS.c= $(CC) -E -MMD $(DEFS) $(CPPFLAGS)
19 GEN_DEPS.cc= $(CXX) -E -MMD $(DEFS) $(CPPFLAGS)
20
21 ## Commands to compile
22 COMPILE.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -fno-common -c
23 COMPILE.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -fno-common -c
24
25 ## Commands to make a shared library
26 SHLIB.c= $(CC) -dynamiclib -dynamic $(CFLAGS) $(LDFLAGS) -install_name $(MIDDLE_SO_TARGET)
27 SHLIB.cc= $(CXX) -dynamiclib -dynamic $(CXXFLAGS) $(LDFLAGS) -install_name $(MIDDLE_SO_TARGET)
28
29 ## Compiler switch to embed a runtime search path
30 LD_RPATH=
31 LD_RPATH_PRE=
32
33 ## Environment variable to set a runtime search path
34 LDLIBRARYPATH_ENVVAR = DYLD_LIBRARY_PATH
35
36 ## Shared object suffix
37 SO= dylib
38 ## Non-shared intermediate object suffix
39 STATIC_O = ao
40
41 ## Versioned target for a shared library.
42 FINAL_SO_TARGET = $(basename $(SO_TARGET)).$(SO_TARGET_VERSION).$(SO)
43 MIDDLE_SO_TARGET = $(basename $(SO_TARGET)).$(SO_TARGET_VERSION_MAJOR).$(SO)
44
45 ## Compilation rules
46 %.$(STATIC_O): $(srcdir)/%.c
47 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
48 %.o: $(srcdir)/%.c
49 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
50
51 %.$(STATIC_O): $(srcdir)/%.cpp
52 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
53 %.o: $(srcdir)/%.cpp
54 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
55
56 ../data/%.o: ../data/%.c
57 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
58
59 ## Dependency rules
60 %.d : $(srcdir)/%.c
61 @echo "generating dependency information for $<"
62 @$(GEN_DEPS.c) $< -o $@
63 @mv $@ $@~
64 @( echo '/\.[ch]$$' ; echo '+,$$d' ; echo "wq" ) | ed $@~ 2>/dev/null >/dev/null || exit 0
65 @echo -n "$@ " > $@
66 @cat < $@~ >> $@
67 @-rm $@~
68
69 %.d : $(srcdir)/%.cpp
70 @echo "generating dependency information for $<"
71 @$(GEN_DEPS.cc) $< -o $@
72 @mv $@ $@~
73 @( echo '/\.[ch]$$' ; echo '+,$$d' ; echo "wq" ) | ed $@~ 2>/dev/null >/dev/null || exit 0
74 @echo -n "$@ " > $@
75 @cat < $@~ >> $@
76 @-rm $@~
77
78 ## Versioned libraries rules
79
80 %.$(SO_TARGET_VERSION_MAJOR).$(SO): %.$(SO_TARGET_VERSION).$(SO)
81 $(RM) $@ && ln -s ${<F} $@
82 %.$(SO): %.$(SO_TARGET_VERSION_MAJOR).$(SO)
83 $(RM) $@ && ln -s ${*F}.$(SO_TARGET_VERSION).$(SO) $@
84
85 ## End Darwin-specific setup