michael@0: ## -*-makefile-*- michael@0: ## Aix-specific setup (for Visual Age 5+) michael@0: ## Copyright (c) 1999-2010, International Business Machines Corporation and michael@0: ## others. All Rights Reserved. michael@0: michael@0: ## Commands to generate dependency files michael@0: GEN_DEPS.c= $(CC) -E -M $(DEFS) $(CPPFLAGS) michael@0: GEN_DEPS.cc= $(CXX) -E -M $(DEFS) $(CPPFLAGS) michael@0: michael@0: # -qroconst make the strings readonly, which is usually the default. michael@0: # This helps in the data library, michael@0: # -qproto assumes all functions are prototyped (for optimization) michael@0: # -qrtti turns on compiler RTTI, required beginning with ICU 4.6 michael@0: CFLAGS += -qproto -qroconst michael@0: CXXFLAGS += -qproto -qroconst -qrtti michael@0: michael@0: # If you readd this line, you must change the SO value michael@0: #LDFLAGS += -brtl michael@0: michael@0: ifeq ($(UCLN_NO_AUTO_CLEANUP),0) michael@0: # set up init point. michael@0: UCLN_FINI = ucln_fini$(TARGET_STUBNAME)_$(SO_TARGET_VERSION_MAJOR)$(ICULIBSUFFIXCNAME) michael@0: CPPFLAGS_FINI = -DUCLN_FINI=$(UCLN_FINI) michael@0: LDFLAGS_FINI = -binitfini::$(UCLN_FINI) michael@0: michael@0: CPPFLAGSICUUC += $(CPPFLAGS_FINI) michael@0: LDFLAGSICUUC += $(LDFLAGS_FINI) michael@0: CPPFLAGSICUIO += $(CPPFLAGS_FINI) michael@0: LDFLAGSICUIO += $(LDFLAGS_FINI) michael@0: CPPFLAGSICUI18N += $(CPPFLAGS_FINI) michael@0: LDFLAGSICUI18N += $(LDFLAGS_FINI) michael@0: CPPFLAGSCTESTFW += $(CPPFLAGS_FINI) michael@0: LDFLAGSCTESTFW += $(LDFLAGS_FINI) michael@0: michael@0: # ICUUC, ICUIO, ICUI18N, CTESTFW michael@0: endif michael@0: michael@0: ## We need to delete things prior to linking, or else we'll get michael@0: ## SEVERE ERROR: output file in use .. on AIX. michael@0: ## But, shell script version should NOT delete target as we don't michael@0: ## have $@ in that context. (SH = only shell script, icu-config) michael@0: AIX_PREDELETE=rm -f $@ ; michael@0: #SH# AIX_PREDELETE= michael@0: michael@0: ## Commands to link michael@0: ## We need to use the C++ linker, even when linking C programs, since michael@0: ## our libraries contain C++ code (C++ static init not called) michael@0: LINK.c= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS) michael@0: LINK.cc= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS) michael@0: michael@0: ## Commands to make a shared library michael@0: ## -G means -berok -brtl -bnortllib -bnosymbolic -bnoautoexp michael@0: ## -bh:8 means halt on errors or worse. We don't display warnings about michael@0: ## duplicate inline symbols. michael@0: SHLIB.c= $(AIX_PREDELETE) $(CXX) -qmkshrobj -G $(LDFLAGS) michael@0: SHLIB.cc= $(AIX_PREDELETE) $(CXX) -qmkshrobj -G $(LDFLAGS) michael@0: michael@0: ## Compiler switch to embed a runtime search path michael@0: LD_RPATH= -I michael@0: LD_RPATH_PRE= michael@0: michael@0: ## Environment variable to set a runtime search path michael@0: LDLIBRARYPATH_ENVVAR = LIBPATH michael@0: michael@0: # The following is for Makefile.inc's use. michael@0: ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR) michael@0: michael@0: # this one is for icudefs.mk's use michael@0: ifeq ($(ENABLE_SHARED),YES) michael@0: SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR) michael@0: endif michael@0: michael@0: LD_SONAME = michael@0: michael@0: ## The type of assembly needed when pkgdata is used for generating shared libraries. michael@0: GENCCODE_ASSEMBLY=-a xlc michael@0: michael@0: ## Shared object suffix michael@0: SOBJ= so michael@0: # without the -brtl option, the library names use .a. AIX is funny that way. michael@0: SO= a michael@0: ## Non-shared intermediate object suffix michael@0: STATIC_O = o michael@0: michael@0: ## Override Versioned target for a shared library. michael@0: FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO) michael@0: MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) michael@0: SHARED_OBJECT = $(notdir $(FINAL_SO_TARGET:.$(SO)=.$(SOBJ))) michael@0: SHARED_OBJECT_NO_VERSION= $(basename $(SO_TARGET)).$(SOBJ) michael@0: michael@0: ## Build archive from shared object michael@0: %.a : %.so michael@0: ln -f $< $(SHARED_OBJECT_NO_VERSION) michael@0: $(AIX_PREDELETE) $(AR) $(ARFLAGS) $@ $(SHARED_OBJECT_NO_VERSION) michael@0: rm -f $(SHARED_OBJECT_NO_VERSION) michael@0: $(LIBDIR)/%.a : %.so michael@0: ln -f $< $(SHARED_OBJECT_NO_VERSION) michael@0: $(AIX_PREDELETE) $(AR) $(ARFLAGS) $@ $(SHARED_OBJECT_NO_VERSION) michael@0: rm -f $(SHARED_OBJECT_NO_VERSION) michael@0: michael@0: ## Build import list from export list michael@0: %.e : %.exp michael@0: @echo "Building an import list for $<" michael@0: @$(SHELL) -ec "echo '#! $*.a($*.so)' | cat - $< > $@" michael@0: michael@0: ## Compilation rules michael@0: %.$(STATIC_O): $(srcdir)/%.c michael@0: $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< michael@0: %.o: $(srcdir)/%.c michael@0: $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< michael@0: michael@0: %.$(STATIC_O): $(srcdir)/%.cpp michael@0: $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< michael@0: %.o: $(srcdir)/%.cpp michael@0: $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< michael@0: michael@0: michael@0: ## Dependency rules michael@0: %.d : %.u michael@0: @$(SHELL) -ec 'cat $< \ michael@0: | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ michael@0: [ -s $@ ] || rm -f $@ ; rm -f $<' michael@0: michael@0: %.u : $(srcdir)/%.c michael@0: @echo "generating dependency information for $<" michael@0: @$(GEN_DEPS.c) $< > /dev/null michael@0: michael@0: %.u : $(srcdir)/%.cpp michael@0: @echo "generating dependency information for $<" michael@0: @$(GEN_DEPS.cc) $< > /dev/null michael@0: michael@0: ## Versioned libraries rules michael@0: %$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO) michael@0: $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@ michael@0: %.$(SO): %$(SO_TARGET_VERSION).$(SO) michael@0: $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@ michael@0: michael@0: ## End Aix-specific setup