]> git.saurik.com Git - apple/icu.git/blame - icuSources/config/mh-aix-gcc
ICU-400.37.tar.gz
[apple/icu.git] / icuSources / config / mh-aix-gcc
CommitLineData
374ca955 1## -*-makefile-*-
46f4442e 2## Copyright (c) 2003-2007 IBM, Ken Foskey, and others. All rights reserved.
374ca955
A
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
10GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
11GEN_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)
16LINK.c= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS)
17LINK.cc= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS)
18
19## Commands to make a shared library
20SHLIB.c= $(AIX_PREDELETE) $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-bexpall
21SHLIB.cc= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -Wl,-bexpall
374ca955
A
22
23## Compiler switch to embed a runtime search path
24LD_RPATH= -I
25LD_RPATH_PRE=
26
27## enable the shared lib loader
28LDFLAGS += -Wl,-bbigtoc
29
73c04bcf
A
30## These are the library specific LDFLAGS
31LDFLAGSICUDT=-nodefaultlibs -nostdlib
32
374ca955
A
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)
37AIX_PREDELETE=rm -f $@ ;
38#SH# AIX_PREDELETE=
39
40## Environment variable to set a runtime search path
41LDLIBRARYPATH_ENVVAR = LIBPATH
42
43## Override Versioned target for a shared library.
44FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
45MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
46f4442e 46SHARED_OBJECT = $(notdir $(FINAL_SO_TARGET:.$(SO)=.$(SOBJ)))
374ca955
A
47
48# The following is for Makefile.inc's use.
49ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR)
50
51# this one is for icudefs.mk's use
52ifeq ($(ENABLE_SHARED),YES)
53SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR)
54endif
55
56## Compiler switch to embed a library name. Not present on AIX.
57LD_SONAME =
58
73c04bcf
A
59## The type of assembly needed when pkgdata is used for generating shared libraries.
60GENCCODE_ASSEMBLY=-a xlc
61
374ca955 62## Shared object suffix
46f4442e
A
63SOBJ= so
64# without the -brtl option, the library names use .a. AIX is funny that way.
374ca955
A
65SO= a
66A= a
67
68## Non-shared intermediate object suffix
69STATIC_O = o
70
71## Special AIX rules
72
73## Build archive from shared object
74%.a : %.so
75 $(AR) $(ARFLAGS) $@ $<
46f4442e
A
76$(LIBDIR)/%.a : %.so
77 $(AR) $(ARFLAGS) $@ $<
374ca955
A
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
118BIR_LDFLAGS= -Wl,-bE:$(NAME).map,-bnoexpall
119
374ca955
A
120# Dependencies [i.e. map files] for the final library
121BIR_DEPS= $(NAME).map
122