2 ## Copyright (c) 2003-2004 IBM, Ken Foskey, and others. All rights reserved.
4 ## Aix-specific setup (for gcc)
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
9 ## Commands to generate dependency files
10 GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
11 GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
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)
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 #SHLIB.c= $(AIX_PREDELETE) $(AIX_SHLIB) -p 5000 $(LDFLAGS) -bexpall
23 #SHLIB.cc= $(AIX_PREDELETE) $(AIX_SHLIB) -p 5000 $(LDFLAGS) -bexpall
25 ## Compiler switch to embed a runtime search path
29 ## enable the shared lib loader
30 LDFLAGS += -Wl,-bbigtoc
32 ## We need to delete things prior to linking, or else we'll get
33 ## SEVERE ERROR: output file in use .. on AIX.
34 ## But, shell script version should NOT delete target as we don't
35 ## have $@ in that context. (SH = only shell script, icu-config)
36 AIX_PREDELETE=rm -f $@ ;
39 ## Environment variable to set a runtime search path
40 LDLIBRARYPATH_ENVVAR = LIBPATH
42 ## Override Versioned target for a shared library.
43 FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
44 MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
46 # The following is for Makefile.inc's use.
47 ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR)
49 # this one is for icudefs.mk's use
50 ifeq ($(ENABLE_SHARED),YES)
51 SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR)
54 ## Compiler switch to embed a library name. Not present on AIX.
57 ## Shared object suffix
61 ## Non-shared intermediate object suffix
66 ## Build archive from shared object
68 $(AR) $(ARFLAGS) $@ $<
70 ## Build import list from export list
72 @echo "Building an import list for $<"
73 @$(SHELL) -ec "echo '#! $*.a($*.so)' | cat - $< > $@"
76 %.$(STATIC_O): $(srcdir)/%.c
77 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
79 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
81 %.$(STATIC_O): $(srcdir)/%.cpp
82 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
84 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
89 @echo "generating dependency information for $<"
90 @$(SHELL) -ec '$(GEN_DEPS.c) $< \
91 | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
92 [ -s $@ ] || rm -f $@'
95 @echo "generating dependency information for $<"
96 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
97 | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
98 [ -s $@ ] || rm -f $@'
100 ## Versioned libraries rules
101 %$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
102 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
103 %.$(SO): %$(SO_TARGET_VERSION).$(SO)
104 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
107 ## BIR - bind with internal references [so app data and icu data doesn't collide]
108 # LDflags that pkgdata will use
109 BIR_LDFLAGS= -Wl,-bE:$(NAME).map,-bnoexpall
111 # CPPflags for genccode/gencmn
112 BIR_CPPFLAGS= -DU_HAVE_BIND_INTERNAL_REFERENCES
114 # Dependencies [i.e. map files] for the final library
115 BIR_DEPS= $(NAME).map