2 ## Aix-specific setup (for Visual Age 5+)
3 ## Copyright (c) 1999-2005, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 ## Commands to generate dependency files
7 GEN_DEPS.c= $(CC) -E -M $(DEFS) $(CPPFLAGS)
8 GEN_DEPS.cc= $(CXX) -E -M $(DEFS) $(CPPFLAGS)
10 # -qroconst make the strings readonly, which is usually the default.
11 # This helps in the data library,
12 # -qproto assumes all functions are prototyped (for optimization)
13 CFLAGS += -qproto -qroconst
14 CXXFLAGS += -qproto -qroconst
16 # If you readd this line, you must change the SO value
19 ## We need to delete things prior to linking, or else we'll get
20 ## SEVERE ERROR: output file in use .. on AIX.
21 ## But, shell script version should NOT delete target as we don't
22 ## have $@ in that context. (SH = only shell script, icu-config)
23 AIX_PREDELETE=rm -f $@ ;
27 ## We need to use the C++ linker, even when linking C programs, since
28 ## our libraries contain C++ code (C++ static init not called)
29 LINK.c= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS)
30 LINK.cc= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS)
32 ## Commands to make a shared library
33 ## -G means -berok -brtl -bnortllib -bnosymbolic -bnoautoexp
34 ## -bh:8 means halt on errors or worse. We don't display warnings about
35 ## duplicate inline symbols.
36 SHLIB.c= $(AIX_PREDELETE) $(CXX) -qmkshrobj -G $(LDFLAGS)
37 SHLIB.cc= $(AIX_PREDELETE) $(CXX) -qmkshrobj -G $(LDFLAGS)
39 ## Compiler switch to embed a runtime search path
43 ## Environment variable to set a runtime search path
44 LDLIBRARYPATH_ENVVAR = LIBPATH
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)
56 ## The type of assembly needed when pkgdata is used for generating shared libraries.
57 GENCCODE_ASSEMBLY=-a xlc
59 ## Shared object suffix
61 # without the -brtl option, the library names use .a. AIX is funny that way.
63 ## Non-shared intermediate object suffix
66 ## Override Versioned target for a shared library.
67 FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
68 MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
69 SHARED_OBJECT = $(notdir $(FINAL_SO_TARGET:.$(SO)=.$(SOBJ)))
71 ## Build archive from shared object
73 $(AR) $(ARFLAGS) $@ $<
75 $(AR) $(ARFLAGS) $@ $<
77 ## Build import list from export list
79 @echo "Building an import list for $<"
80 @$(SHELL) -ec "echo '#! $*.a($*.so)' | cat - $< > $@"
83 %.$(STATIC_O): $(srcdir)/%.c
84 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
86 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
88 %.$(STATIC_O): $(srcdir)/%.cpp
89 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
91 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
96 @$(SHELL) -ec 'cat $< \
97 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
98 [ -s $@ ] || rm -f $@ ; rm -f $<'
101 @echo "generating dependency information for $<"
102 @$(SHELL) -ec '$(GEN_DEPS.c) $< > /dev/null'
104 %.u : $(srcdir)/%.cpp
105 @echo "generating dependency information for $<"
106 @$(SHELL) -ec '$(GEN_DEPS.cc) $< > /dev/null'
108 ## Versioned libraries rules
109 %$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
110 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
111 %.$(SO): %$(SO_TARGET_VERSION).$(SO)
112 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
114 ## End Aix-specific setup