]> git.saurik.com Git - apple/icu.git/blob - icuSources/config/mh-aix-gcc
ICU-400.37.tar.gz
[apple/icu.git] / icuSources / config / mh-aix-gcc
1 ## -*-makefile-*-
2 ## Copyright (c) 2003-2007 IBM, Ken Foskey, and others. All rights reserved.
3 ##
4 ## Aix-specific setup (for gcc)
5 ##
6 ## Please note: AIX does NOT have library versioning per se (there is no 'SONAME' capability).
7 ## So, we are using 'windows' style library names, that is, libicuuc20.1.so instead of libicuuc.so.20.1
8
9 ## Commands to generate dependency files
10 GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
11 GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
12
13 ## Commands to link
14 ## We need to use the C++ linker, even when linking C programs, since
15 ## our libraries contain C++ code (C++ static init not called)
16 LINK.c= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS)
17 LINK.cc= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS)
18
19 ## Commands to make a shared library
20 SHLIB.c= $(AIX_PREDELETE) $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-bexpall
21 SHLIB.cc= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -Wl,-bexpall
22
23 ## Compiler switch to embed a runtime search path
24 LD_RPATH= -I
25 LD_RPATH_PRE=
26
27 ## enable the shared lib loader
28 LDFLAGS += -Wl,-bbigtoc
29
30 ## These are the library specific LDFLAGS
31 LDFLAGSICUDT=-nodefaultlibs -nostdlib
32
33 ## We need to delete things prior to linking, or else we'll get
34 ## SEVERE ERROR: output file in use .. on AIX.
35 ## But, shell script version should NOT delete target as we don't
36 ## have $@ in that context. (SH = only shell script, icu-config)
37 AIX_PREDELETE=rm -f $@ ;
38 #SH# AIX_PREDELETE=
39
40 ## Environment variable to set a runtime search path
41 LDLIBRARYPATH_ENVVAR = LIBPATH
42
43 ## Override Versioned target for a shared library.
44 FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
45 MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
46 SHARED_OBJECT = $(notdir $(FINAL_SO_TARGET:.$(SO)=.$(SOBJ)))
47
48 # The following is for Makefile.inc's use.
49 ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR)
50
51 # this one is for icudefs.mk's use
52 ifeq ($(ENABLE_SHARED),YES)
53 SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR)
54 endif
55
56 ## Compiler switch to embed a library name. Not present on AIX.
57 LD_SONAME =
58
59 ## The type of assembly needed when pkgdata is used for generating shared libraries.
60 GENCCODE_ASSEMBLY=-a xlc
61
62 ## Shared object suffix
63 SOBJ= so
64 # without the -brtl option, the library names use .a. AIX is funny that way.
65 SO= a
66 A= a
67
68 ## Non-shared intermediate object suffix
69 STATIC_O = o
70
71 ## Special AIX rules
72
73 ## Build archive from shared object
74 %.a : %.so
75 $(AR) $(ARFLAGS) $@ $<
76 $(LIBDIR)/%.a : %.so
77 $(AR) $(ARFLAGS) $@ $<
78
79 ## Build import list from export list
80 %.e : %.exp
81 @echo "Building an import list for $<"
82 @$(SHELL) -ec "echo '#! $*.a($*.so)' | cat - $< > $@"
83
84 ## Compilation rules
85 %.$(STATIC_O): $(srcdir)/%.c
86 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
87 %.o: $(srcdir)/%.c
88 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
89
90 %.$(STATIC_O): $(srcdir)/%.cpp
91 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
92 %.o: $(srcdir)/%.cpp
93 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
94
95
96 ## Dependency rules
97 %.d: $(srcdir)/%.c
98 @echo "generating dependency information for $<"
99 @$(SHELL) -ec '$(GEN_DEPS.c) $< \
100 | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
101 [ -s $@ ] || rm -f $@'
102
103 %.d: $(srcdir)/%.cpp
104 @echo "generating dependency information for $<"
105 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
106 | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
107 [ -s $@ ] || rm -f $@'
108
109 ## Versioned libraries rules
110 %$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
111 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
112 %.$(SO): %$(SO_TARGET_VERSION).$(SO)
113 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
114
115
116 ## BIR - bind with internal references [so app data and icu data doesn't collide]
117 # LDflags that pkgdata will use
118 BIR_LDFLAGS= -Wl,-bE:$(NAME).map,-bnoexpall
119
120 # Dependencies [i.e. map files] for the final library
121 BIR_DEPS= $(NAME).map
122