]> git.saurik.com Git - apple/icu.git/blame - icuSources/config/mh-aix-gcc
ICU-8.11.4.tar.gz
[apple/icu.git] / icuSources / config / mh-aix-gcc
CommitLineData
374ca955 1## -*-makefile-*-
73c04bcf 2## Copyright (c) 2003-2006 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
22#SHLIB.c= $(AIX_PREDELETE) $(AIX_SHLIB) -p 5000 $(LDFLAGS) -bexpall
23#SHLIB.cc= $(AIX_PREDELETE) $(AIX_SHLIB) -p 5000 $(LDFLAGS) -bexpall
24
25## Compiler switch to embed a runtime search path
26LD_RPATH= -I
27LD_RPATH_PRE=
28
29## enable the shared lib loader
30LDFLAGS += -Wl,-bbigtoc
31
73c04bcf
A
32## These are the library specific LDFLAGS
33LDFLAGSICUDT=-nodefaultlibs -nostdlib
34
374ca955
A
35## We need to delete things prior to linking, or else we'll get
36## SEVERE ERROR: output file in use .. on AIX.
37## But, shell script version should NOT delete target as we don't
38## have $@ in that context. (SH = only shell script, icu-config)
39AIX_PREDELETE=rm -f $@ ;
40#SH# AIX_PREDELETE=
41
42## Environment variable to set a runtime search path
43LDLIBRARYPATH_ENVVAR = LIBPATH
44
45## Override Versioned target for a shared library.
46FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
47MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
48
49# The following is for Makefile.inc's use.
50ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR)
51
52# this one is for icudefs.mk's use
53ifeq ($(ENABLE_SHARED),YES)
54SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR)
55endif
56
57## Compiler switch to embed a library name. Not present on AIX.
58LD_SONAME =
59
73c04bcf
A
60## The type of assembly needed when pkgdata is used for generating shared libraries.
61GENCCODE_ASSEMBLY=-a xlc
62
374ca955
A
63## Shared object suffix
64SO= a
65A= a
66
67## Non-shared intermediate object suffix
68STATIC_O = o
69
70## Special AIX rules
71
72## Build archive from shared object
73%.a : %.so
74 $(AR) $(ARFLAGS) $@ $<
75
76## Build import list from export list
77%.e : %.exp
78 @echo "Building an import list for $<"
79 @$(SHELL) -ec "echo '#! $*.a($*.so)' | cat - $< > $@"
80
81## Compilation rules
82%.$(STATIC_O): $(srcdir)/%.c
83 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
84%.o: $(srcdir)/%.c
85 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
86
87%.$(STATIC_O): $(srcdir)/%.cpp
88 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
89%.o: $(srcdir)/%.cpp
90 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
91
92
93## Dependency rules
94%.d: $(srcdir)/%.c
95 @echo "generating dependency information for $<"
96 @$(SHELL) -ec '$(GEN_DEPS.c) $< \
97 | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
98 [ -s $@ ] || rm -f $@'
99
100%.d: $(srcdir)/%.cpp
101 @echo "generating dependency information for $<"
102 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
103 | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
104 [ -s $@ ] || rm -f $@'
105
106## Versioned libraries rules
107%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
108 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
109%.$(SO): %$(SO_TARGET_VERSION).$(SO)
110 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
111
112
113## BIR - bind with internal references [so app data and icu data doesn't collide]
114# LDflags that pkgdata will use
115BIR_LDFLAGS= -Wl,-bE:$(NAME).map,-bnoexpall
116
374ca955
A
117# Dependencies [i.e. map files] for the final library
118BIR_DEPS= $(NAME).map
119