2000-02-18 21:05:24 +00:00
|
|
|
## -*-makefile-*-
|
|
|
|
## OS400-specific setup (for cross build)
|
2005-07-01 06:08:07 +00:00
|
|
|
## Copyright (c) 1999-2005, International Business Machines Corporation and
|
2000-02-18 21:05:24 +00:00
|
|
|
## others. All Rights Reserved.
|
|
|
|
|
|
|
|
GEN_DEPS.c= $(CC1) -E -M $(DEFS) $(CPPFLAGS)
|
|
|
|
GEN_DEPS.cc= $(CXX1) -E -M $(DEFS) $(CPPFLAGS)
|
|
|
|
|
2004-08-27 21:37:46 +00:00
|
|
|
THREADSCPPFLAGS = -D_MULTI_THREADED
|
2003-04-02 17:47:25 +00:00
|
|
|
|
2000-02-18 21:05:24 +00:00
|
|
|
## Commands to compile
|
2004-08-27 21:37:46 +00:00
|
|
|
# -qTERASPACE: large pointers
|
|
|
|
# -qPFROPT=*STRDONLY: Strings are read-only
|
2004-09-14 17:34:17 +00:00
|
|
|
COMPILE.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c -qTERASPACE=*YES -qSTGMDL=*INHERIT -qPFROPT=*STRDONLY
|
|
|
|
COMPILE.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c -qTERASPACE=*YES -qSTGMDL=*INHERIT -qPFROPT=*STRDONLY
|
2001-06-01 18:15:03 +00:00
|
|
|
|
2000-02-18 21:05:24 +00:00
|
|
|
## Commands to link
|
|
|
|
## We need to use the C++ linker, even when linking C programs, since
|
|
|
|
## our libraries contain C++ code (C++ static init not called)
|
2002-05-29 16:47:28 +00:00
|
|
|
LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS) -qOPTION='*DUPPROC *DUPVAR'
|
|
|
|
LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -qOPTION='*DUPPROC *DUPVAR'
|
2000-02-18 21:05:24 +00:00
|
|
|
|
|
|
|
## Commands to make a shared library
|
2004-09-14 17:34:17 +00:00
|
|
|
# -qALWLIBUPD: It allows the compiled service program to have dependencies on
|
|
|
|
# service programs in a different library than that specified originally
|
|
|
|
# by CRTSRVPGM after having used the UPDSRVPGM command.
|
|
|
|
# Similar to -fPIC and -install_name on other compilers, but different.
|
|
|
|
SHLIB.c= ld -v -qOPTION='*DUPPROC *DUPVAR' -qALWLIBUPD=*YES
|
|
|
|
SHLIB.cc= ld -v -qOPTION='*DUPPROC *DUPVAR' -qALWLIBUPD=*YES
|
2000-02-18 21:05:24 +00:00
|
|
|
AR = qar
|
|
|
|
ARFLAGS = -cuv
|
|
|
|
|
|
|
|
## Compiler switch to embed a runtime search path
|
|
|
|
LD_RPATH= -I
|
|
|
|
LD_RPATH_PRE= -I
|
|
|
|
|
2004-04-12 23:20:23 +00:00
|
|
|
## Make target to rebind the common library
|
|
|
|
## to the actual data versus the stub data
|
|
|
|
POST_DATA_BUILD = os400-data-rebind
|
|
|
|
|
2004-05-11 04:51:53 +00:00
|
|
|
# The stubdata directory is the same directory as the normal data library.
|
|
|
|
STUBDATA_LIBDIR = $(LIBDIR)/
|
|
|
|
|
2000-09-15 05:07:43 +00:00
|
|
|
## Versioned target for a shared library.
|
|
|
|
FINAL_SO_TARGET = $(SO_TARGET)
|
|
|
|
MIDDLE_SO_TARGET =
|
|
|
|
|
2004-04-19 17:32:30 +00:00
|
|
|
# this one is for icudefs.mk's use
|
2004-04-28 06:34:25 +00:00
|
|
|
ifeq ($(ENABLE_SHARED),YES)
|
2004-04-19 17:32:30 +00:00
|
|
|
SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR)
|
2004-04-28 06:34:25 +00:00
|
|
|
endif
|
2004-04-19 17:32:30 +00:00
|
|
|
|
|
|
|
# this one is for the individual make files and linking
|
|
|
|
ICULIBSUFFIX = $(SO_TARGET_VERSION_SUFFIX)
|
|
|
|
|
2000-02-18 21:05:24 +00:00
|
|
|
## object suffix
|
|
|
|
TO= o
|
|
|
|
|
|
|
|
## Shared object suffix
|
2003-06-04 18:03:59 +00:00
|
|
|
SO= so
|
2000-10-09 19:06:57 +00:00
|
|
|
## Non-shared intermediate object suffix
|
|
|
|
STATIC_O = o
|
2000-02-18 21:05:24 +00:00
|
|
|
|
|
|
|
## Platform command to remove or move executable target
|
|
|
|
RMV = del
|
2000-10-03 22:51:46 +00:00
|
|
|
## Platform commands to remove or move executable and library targets
|
|
|
|
INSTALL-S = cp -fph
|
|
|
|
INSTALL-L = $(INSTALL-S)
|
2000-02-18 21:05:24 +00:00
|
|
|
|
2004-04-19 17:32:30 +00:00
|
|
|
# Stub name overrides for iSeries
|
|
|
|
DATA_STUBNAME = dt
|
|
|
|
I18N_STUBNAME = in
|
|
|
|
CTESTFW_STUBNAME = tf
|
|
|
|
|
2000-02-18 21:05:24 +00:00
|
|
|
## Link commands to link to ICU service programs
|
2004-04-19 17:32:30 +00:00
|
|
|
LIBICUDT = $(LIBDIR)/$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX).$(SO)
|
|
|
|
LIBICUUC = $(LIBDIR)/$(LIBICU)$(COMMON_STUBNAME)$(ICULIBSUFFIX).$(SO)
|
|
|
|
LIBICUI18N = $(LIBDIR)/$(LIBICU)$(I18N_STUBNAME)$(ICULIBSUFFIX).$(SO)
|
|
|
|
LIBICULE = $(LIBDIR)/$(LIBICU)$(LAYOUT_STUBNAME)$(ICULIBSUFFIX).$(SO)
|
|
|
|
LIBICULX = $(LIBDIR)/$(LIBICU)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX).$(SO)
|
|
|
|
LIBCTESTFW = $(top_builddir)/tools/ctestfw/$(LIBICU)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX).$(SO)
|
|
|
|
LIBICUTOOLUTIL = $(LIBDIR)/$(LIBICU)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX).$(SO)
|
|
|
|
LIBICUIO= $(LIBDIR)/$(LIBICU)$(IO_STUBNAME)$(ICULIBSUFFIX).$(SO)
|
2000-03-29 20:17:28 +00:00
|
|
|
|
2000-02-18 21:05:24 +00:00
|
|
|
## Special OS400 rules
|
|
|
|
|
|
|
|
## Build archive from shared object
|
|
|
|
%.a : %.o
|
|
|
|
$(AR) $(ARFLAGS) $@ $<
|
|
|
|
|
|
|
|
## Build import list from export list
|
|
|
|
%.e : %.exp
|
|
|
|
@echo "Building an import list for $<"
|
|
|
|
@$(SHELL) -ec "echo '#! $*.a($*.so)' | cat - $< > $@"
|
|
|
|
|
|
|
|
## Compilation rules
|
2000-10-09 19:06:57 +00:00
|
|
|
%.$(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 $@ $<
|
2000-02-18 21:05:24 +00:00
|
|
|
|
|
|
|
%.qwobj : $(srcdir)/%.c
|
|
|
|
$(COMPILE.c) -o $@ $<
|
|
|
|
|
|
|
|
%.qwobj : $(srcdir)/%.cpp
|
|
|
|
$(COMPILE.cc) -o $@ $<
|
|
|
|
|
|
|
|
## Dependency rules
|
|
|
|
%.d : %.u
|
|
|
|
# @$(SHELL) -ec 'cat $< \
|
|
|
|
# | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
|
|
|
|
# [ -s $@ ] || rm -f $@ ; rm -f $<'
|
|
|
|
|
|
|
|
%.u : $(srcdir)/%.c
|
2002-01-04 23:48:46 +00:00
|
|
|
@echo "generating dependency information for $<"
|
2000-02-18 21:05:24 +00:00
|
|
|
# @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1'
|
|
|
|
# @$(SHELL) -ec '$(GEN_DEPS.c) -f $*.u $< > /dev/null 2>&1'
|
|
|
|
|
|
|
|
%.u : $(srcdir)/%.cpp
|
2002-01-04 23:48:46 +00:00
|
|
|
@echo "generating dependency information for $<"
|
2000-02-18 21:05:24 +00:00
|
|
|
# @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1'
|
|
|
|
# @$(SHELL) -ec '$(GEN_DEPS.cc) -f $*.u $< > /dev/null 2>&1'
|
|
|
|
|
|
|
|
## End OS400-specific setup
|