1## -*-makefile-*- 2## Copyright (C) 2016 and later: Unicode, Inc. and others. 3## License & terms of use: http://www.unicode.org/copyright.html 4## Aix-specific setup (for Visual Age 5+) 5## Copyright (c) 1999-2010, International Business Machines Corporation and 6## others. All Rights Reserved. 7 8## Commands to generate dependency files 9GEN_DEPS.c= $(CC) -E -M $(DEFS) $(CPPFLAGS) 10GEN_DEPS.cc= $(CXX) -E -M $(DEFS) $(CPPFLAGS) 11 12# -qroconst make the strings readonly, which is usually the default. 13# This helps in the data library, 14# -qproto assumes all functions are prototyped (for optimization) 15# -qrtti turns on compiler RTTI, required beginning with ICU 4.6 16CFLAGS += -qproto -qroconst 17CXXFLAGS += -qproto -qroconst -qrtti 18 19# If you readd this line, you must change the SO value 20#LDFLAGS += -brtl 21 22ifeq ($(UCLN_NO_AUTO_CLEANUP),0) 23# set up init point. 24UCLN_FINI = ucln_fini$(TARGET_STUBNAME)_$(SO_TARGET_VERSION_MAJOR)$(ICULIBSUFFIXCNAME) 25CPPFLAGS_FINI = -DUCLN_FINI=$(UCLN_FINI) 26LDFLAGS_FINI = -binitfini::$(UCLN_FINI) 27 28CPPFLAGSICUUC += $(CPPFLAGS_FINI) 29LDFLAGSICUUC += $(LDFLAGS_FINI) 30CPPFLAGSICUIO += $(CPPFLAGS_FINI) 31LDFLAGSICUIO += $(LDFLAGS_FINI) 32CPPFLAGSICUI18N += $(CPPFLAGS_FINI) 33LDFLAGSICUI18N += $(LDFLAGS_FINI) 34CPPFLAGSCTESTFW += $(CPPFLAGS_FINI) 35LDFLAGSCTESTFW += $(LDFLAGS_FINI) 36 37# ICUUC, ICUIO, ICUI18N, CTESTFW 38endif 39 40## We need to delete things prior to linking, or else we'll get 41## SEVERE ERROR: output file in use .. on AIX. 42## But, shell script version should NOT delete target as we don't 43## have $@ in that context. (SH = only shell script, icu-config) 44AIX_PREDELETE=rm -f $@ ; 45#SH# AIX_PREDELETE= 46 47## Commands to link 48## We need to use the C++ linker, even when linking C programs, since 49## our libraries contain C++ code (C++ static init not called) 50LINK.c= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS) 51LINK.cc= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS) 52 53## Commands to make a shared library 54## -G means -berok -brtl -bnortllib -bnosymbolic -bnoautoexp 55## -bh:8 means halt on errors or worse. We don't display warnings about 56## duplicate inline symbols. 57SHLIB.c= $(AIX_PREDELETE) $(CXX) -qmkshrobj -G $(LDFLAGS) 58SHLIB.cc= $(AIX_PREDELETE) $(CXX) -qmkshrobj -G $(LDFLAGS) 59 60## Compiler switch to embed a runtime search path 61LD_RPATH= -I 62LD_RPATH_PRE= 63 64## Environment variable to set a runtime search path 65LDLIBRARYPATH_ENVVAR = LIBPATH 66 67# The following is for Makefile.inc's use. 68ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR) 69 70# this one is for icudefs.mk's use 71ifeq ($(ENABLE_SHARED),YES) 72SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR) 73endif 74 75LD_SONAME = 76 77## The type of assembly needed when pkgdata is used for generating shared libraries. 78GENCCODE_ASSEMBLY=-a xlc 79 80## Shared object suffix 81SOBJ= so 82# without the -brtl option, the library names use .a. AIX is funny that way. 83SO= a 84## Non-shared intermediate object suffix 85STATIC_O = o 86 87## Override Versioned target for a shared library. 88FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO) 89MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) 90SHARED_OBJECT = $(notdir $(FINAL_SO_TARGET:.$(SO)=.$(SOBJ))) 91SHARED_OBJECT_NO_VERSION= $(basename $(SO_TARGET)).$(SOBJ) 92 93## Build archive from shared object 94%.a : %.so 95 ln -f $< $(SHARED_OBJECT_NO_VERSION) 96 $(AIX_PREDELETE) $(AR) $(ARFLAGS) $@ $(SHARED_OBJECT_NO_VERSION) 97 rm -f $(SHARED_OBJECT_NO_VERSION) 98$(LIBDIR)/%.a : %.so 99 ln -f $< $(SHARED_OBJECT_NO_VERSION) 100 $(AIX_PREDELETE) $(AR) $(ARFLAGS) $@ $(SHARED_OBJECT_NO_VERSION) 101 rm -f $(SHARED_OBJECT_NO_VERSION) 102 103## Build import list from export list 104%.e : %.exp 105 @echo "Building an import list for $<" 106 @$(SHELL) -ec "echo '#! $*.a($*.so)' | cat - $< > $@" 107 108## Compilation rules 109%.$(STATIC_O): $(srcdir)/%.c 110 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< 111%.o: $(srcdir)/%.c 112 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< 113 114%.$(STATIC_O): $(srcdir)/%.cpp 115 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< 116%.o: $(srcdir)/%.cpp 117 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< 118 119 120## Dependency rules 121%.d : %.u 122 @$(SHELL) -ec 'cat $< \ 123 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ 124 [ -s $@ ] || rm -f $@ ; rm -f $<' 125 126%.u : $(srcdir)/%.c 127 @echo "generating dependency information for $<" 128 @$(GEN_DEPS.c) $< > /dev/null 129 130%.u : $(srcdir)/%.cpp 131 @echo "generating dependency information for $<" 132 @$(GEN_DEPS.cc) $< > /dev/null 133 134## Versioned libraries rules 135%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO) 136 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@ 137%.$(SO): %$(SO_TARGET_VERSION).$(SO) 138 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@ 139 140## End Aix-specific setup 141