icu/icu4c/source/config/mh-os390
2024-09-20 17:12:28 -07:00

156 lines
5.9 KiB
Makefile

## -*-makefile-*-
## Copyright (C) 2016 and later: Unicode, Inc. and others.
## License & terms of use: http://www.unicode.org/copyright.html
## os/390, z/OS specific setup
## Copyright (c) 1999-2014, International Business Machines Corporation and
## others. All Rights Reserved.
###################################################################
# IMPORTANT NOTE #
###################################################################
# Before you try to run the Makefile, make sure you have the #
# environment variables set. #
# #
# To build a version of ICU that does not use IEEE Floating point #
# #
# export ICU_IS_NOT_IEEE754=1 #
###################################################################
BUILD_HOST_ICU=OS390
ifeq (${ICU_IS_NOT_IEEE754}, 1)
ICU_IEEE=-mzos-float-kind=hex -DIEEE_754=0
else
ICU_IEEE=-mzos-float-kind=ieee -DIEEE_754=1
endif
ifeq (${TARGET_ICU_ARCH},)
TARGET_ICU_ARCH=arch10
endif
ifeq (${ICU_PLUGINS_DD},1)
DEFS+=-DICU_PLUGINS_DD
endif
## Flags for position independent code
SHAREDLIBCFLAGS += -fPIC
SHAREDLIBCXXFLAGS += -fPIC
# For a dynamically called DLL module to share access to the POSIX external
# variables, with its caller, the DLL module must define these _SHR_* macros.
SHAREDLIBCPPFLAGS +=-D_SHR_TZNAME -D_SHR_TIMEZONE
CFLAGS +=$(ICU_IEEE) -march=$(TARGET_ICU_ARCH) -mzos-service="$(LIBICU)v$(SO_TARGET_VERSION)"
CXXFLAGS +=$(ICU_IEEE) -march=$(TARGET_ICU_ARCH) -mzos-service="$(LIBICU)v$(SO_TARGET_VERSION)"
ARFLAGS =-cr
LIBCFLAGS +=-fvisibility=hidden
LIBCXXFLAGS +=-fvisibility=hidden
## Commands to generate dependency files
GEN_DEPS.c=makedep
GEN_DEPS.cc=makedep
## Commands to compile
# _CXX_STEPS="-1" is a prelink step when compiling C and C++, and
# it's only needed for long function names
COMPILE.c=$(COMPILE_LINK_ENVVAR) $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c
COMPILE.cc=$(COMPILE_LINK_ENVVAR) $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c
## Commands for shared library (dll)
SHLIB.c=$(COMPILE_LINK_ENVVAR) $(CC) --shared $(LDFLAGS)
SHLIB.cc=$(COMPILE_LINK_ENVVAR) $(CXX) --shared $(LDFLAGS)
## Compiler switch to embed a runtime search path
LD_RPATH=-I
## Environment variable to set a runtime search path
LDLIBRARYPATH_ENVVAR = LIBPATH
## Versioned target for a shared library.
FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
MIDDLE_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
## Versioned import library names.
IMPORT_LIB=$(basename $(notdir $(SO_TARGET))).x
MIDDLE_IMPORT_LIB=$(basename $(notdir $(MIDDLE_SO_TARGET))).x
FINAL_IMPORT_LIB=$(basename $(notdir $(FINAL_SO_TARGET))).x
## Non-shared intermediate object suffix
STATIC_O = o
## ICU_PDS_NAME_PREFIX sets the prefix of the PDS dataset name while keeping the ICU version number.
## To use custom names set ICU_PDS_NAME and ICU_PDS_NAME_SUFFIX
ifeq ($(ICU_PDS_NAME_PREFIX),)
ICU_PDS_NAME_PREFIX=LICU
endif
ifeq ($(ICU_PDS_NAME),)
PDS_FULL_NAME=${ICU_PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}
else
PDS_FULL_NAME=${ICU_PDS_NAME}
endif
BATCH_STUB_TARGET=${PDS_FULL_NAME}DA${ICU_PDS_NAME_SUFFIX}
PKGDATA_DEFS+=-DU_LIBICUDATA_NAME=\"$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)\" -DBATCH_STUB_TARGET=\"$(BATCH_STUB_TARGET)\"
BATCH_COMMON_TARGET=$(LIBDIR)/${PDS_FULL_NAME}UC${ICU_PDS_NAME_SUFFIX}
BATCH_I18N_TARGET=$(LIBDIR)/${PDS_FULL_NAME}IN${ICU_PDS_NAME_SUFFIX}
BATCH_IO_TARGET=$(LIBDIR)/${PDS_FULL_NAME}IO${ICU_PDS_NAME_SUFFIX}
BATCH_LAYOUT_TARGET=$(LIBDIR)/${PDS_FULL_NAME}LE${ICU_PDS_NAME_SUFFIX}
BATCH_LAYOUTEX_TARGET=$(LIBDIR)/${PDS_FULL_NAME}LX${ICU_PDS_NAME_SUFFIX}
BATCH_LIBICUDT=$(top_builddir)/stubdata/${BATCH_STUB_TARGET}.x
BATCH_LIBICUUC=${BATCH_COMMON_TARGET}.x
BATCH_LIBICUI18N=${BATCH_I18N_TARGET}.x
BATCH_LIBICULE=${BATCH_LAYOUT_TARGET}.x
BATCH_LIBICULX=${BATCH_LAYOUTEX_TARGET}.x
## Link commands to link to ICU libs
LIBICUDT=$(top_builddir)/stubdata/$(LIBICU)data$(ICULIBSUFFIX)$(STUB_SUFFIX)$(SO_TARGET_VERSION).x
LIBICUUC=$(LIBDIR)/$(LIBICU)uc$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
LIBICUI18N=$(LIBDIR)/$(LIBICU)i18n$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
LIBICULX=$(LIBDIR)/$(LIBICU)lx$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
LIBICUIO=$(LIBDIR)/$(LIBICU)io$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
LIBCTESTFW=$(top_builddir)/tools/ctestfw/$(LIBICU)test$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
LIBICUTOOLUTIL=$(LIBDIR)/$(LIBICU)tu$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
ifneq (${ICUDATA_CHAR},e)
#SH# if [ "$ICUDATA_CHAR" != "e" ]; then
## We're in ASCII mode.
CFLAGS += -Wc,'ascii'
CXXFLAGS += -Wc,'ascii'
endif
SO = so
## Special 390 rules
## Build archive from object
%.a : $(OBJECTS)
$(AR) $(ARFLAGS) $@ $(OBJECTS)
## Compilation rules
%.$(STATIC_O): $(srcdir)/%.c
$(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
%.o: $(srcdir)/%.c
$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
%.$(STATIC_O): $(srcdir)/%.cpp
$(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
%.o: $(srcdir)/%.cpp
$(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
## Dependency rules
%.d : %.u
@$(SHELL) -ec 'cat $< \
| sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
[ -s $@ ] || rm -f $@ ; rm -f $<'
%.u : $(srcdir)/%.c
@echo "generating dependency information for $<"
@$(SHELL) -ec 'touch $*.u > /dev/null 2>&1'
@$(SHELL) -ec '$(GEN_DEPS.c) -f $*.u $< > /dev/null 2>&1'
%.u : $(srcdir)/%.cpp
@echo "generating dependency information for $<"
@$(SHELL) -ec 'touch $*.u > /dev/null 2>&1'
@$(SHELL) -ec '$(GEN_DEPS.cc) -f $*.u $< > /dev/null 2>&1'
## Versioned libraries rules
%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
$(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
%.$(SO): %$(SO_TARGET_VERSION).$(SO)
$(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
## Install libraries as executable
INSTALL-L=$(INSTALL_PROGRAM)
## End 390-specific setup