]> git.saurik.com Git - apple/icu.git/blame - icuSources/config/mh-os400
ICU-511.25.tar.gz
[apple/icu.git] / icuSources / config / mh-os400
CommitLineData
b75a7d8f
A
1## -*-makefile-*-
2## OS400-specific setup (for cross build)
51004dcb 3## Copyright (c) 1999-2012, International Business Machines Corporation and
b75a7d8f 4## others. All Rights Reserved.
b75a7d8f 5
51004dcb
A
6# This otherwise breaks on OS400 - can't find "shell"
7CURR_FULL_DIR=.
8CURR_SRCCODE_FULL_DIR=.
9
b75a7d8f
A
10GEN_DEPS.c= $(CC1) -E -M $(DEFS) $(CPPFLAGS)
11GEN_DEPS.cc= $(CXX1) -E -M $(DEFS) $(CPPFLAGS)
12
374ca955 13THREADSCPPFLAGS = -D_MULTI_THREADED
b75a7d8f
A
14
15## Commands to compile
374ca955
A
16# -qTERASPACE: large pointers
17# -qPFROPT=*STRDONLY: Strings are read-only
b75a7d8f 18COMPILE.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c -qTERASPACE=*YES -qSTGMDL=*INHERIT -qPFROPT=*STRDONLY
4388f060
A
19COMPILE.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c -qTERASPACE=*YES -qSTGMDL=*INHERIT -qPFROPT=*STRDONLY -qRTTIALL
20
21## ICULD program - run bldiculd.sh in icu/as_is/os400/ to build it
22ICULD=/qsys.lib/$(OUTPUTDIR).lib/iculd.pgm
b75a7d8f
A
23
24## Commands to link
25## We need to use the C++ linker, even when linking C programs, since
26## our libraries contain C++ code (C++ static init not called)
4388f060
A
27LINK.c= $(ICULD) $(CXXFLAGS) $(LDFLAGS) -qOPTION='*DUPPROC *DUPVAR'
28LINK.cc= $(ICULD) $(CXXFLAGS) $(LDFLAGS) -qOPTION='*DUPPROC *DUPVAR'
b75a7d8f
A
29
30## Commands to make a shared library
374ca955
A
31# -qALWLIBUPD: It allows the compiled service program to have dependencies on
32# service programs in a different library than that specified originally
33# by CRTSRVPGM after having used the UPDSRVPGM command.
34# Similar to -fPIC and -install_name on other compilers, but different.
35SHLIB.c= ld -v -qOPTION='*DUPPROC *DUPVAR' -qALWLIBUPD=*YES
36SHLIB.cc= ld -v -qOPTION='*DUPPROC *DUPVAR' -qALWLIBUPD=*YES
b75a7d8f
A
37AR = qar
38ARFLAGS = -cuv
39
40## Compiler switch to embed a runtime search path
41LD_RPATH= -I
42LD_RPATH_PRE= -I
43
374ca955
A
44## Make target to rebind the common library
45## to the actual data versus the stub data
46POST_DATA_BUILD = os400-data-rebind
47
48# The stubdata directory is the same directory as the normal data library.
49STUBDATA_LIBDIR = $(LIBDIR)/
50
b75a7d8f
A
51## Versioned target for a shared library.
52FINAL_SO_TARGET = $(SO_TARGET)
53MIDDLE_SO_TARGET =
54
374ca955
A
55# this one is for icudefs.mk's use
56ifeq ($(ENABLE_SHARED),YES)
57SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR)
58endif
59
60# this one is for the individual make files and linking
61ICULIBSUFFIX = $(SO_TARGET_VERSION_SUFFIX)
62
b75a7d8f
A
63## object suffix
64TO= o
65
66## Shared object suffix
67SO= so
68## Non-shared intermediate object suffix
69STATIC_O = o
70
71## Platform command to remove or move executable target
72RMV = del
73## Platform commands to remove or move executable and library targets
74INSTALL-S = cp -fph
75INSTALL-L = $(INSTALL-S)
76
374ca955
A
77# Stub name overrides for iSeries
78DATA_STUBNAME = dt
79I18N_STUBNAME = in
80CTESTFW_STUBNAME = tf
81
b75a7d8f 82## Link commands to link to ICU service programs
374ca955
A
83LIBICUDT = $(LIBDIR)/$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX).$(SO)
84LIBICUUC = $(LIBDIR)/$(LIBICU)$(COMMON_STUBNAME)$(ICULIBSUFFIX).$(SO)
85LIBICUI18N = $(LIBDIR)/$(LIBICU)$(I18N_STUBNAME)$(ICULIBSUFFIX).$(SO)
86LIBICULE = $(LIBDIR)/$(LIBICU)$(LAYOUT_STUBNAME)$(ICULIBSUFFIX).$(SO)
87LIBICULX = $(LIBDIR)/$(LIBICU)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX).$(SO)
88LIBCTESTFW = $(top_builddir)/tools/ctestfw/$(LIBICU)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX).$(SO)
89LIBICUTOOLUTIL = $(LIBDIR)/$(LIBICU)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX).$(SO)
90LIBICUIO= $(LIBDIR)/$(LIBICU)$(IO_STUBNAME)$(ICULIBSUFFIX).$(SO)
b75a7d8f
A
91
92## Special OS400 rules
93
94## Build archive from shared object
95%.a : %.o
96 $(AR) $(ARFLAGS) $@ $<
97
98## Build import list from export list
99%.e : %.exp
100 @echo "Building an import list for $<"
101 @$(SHELL) -ec "echo '#! $*.a($*.so)' | cat - $< > $@"
102
103## Compilation rules
104%.$(STATIC_O): $(srcdir)/%.c
105 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
106%.o: $(srcdir)/%.c
107 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
108
109%.$(STATIC_O): $(srcdir)/%.cpp
110 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
111%.o: $(srcdir)/%.cpp
112 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
113
114%.qwobj : $(srcdir)/%.c
115 $(COMPILE.c) -o $@ $<
116
117%.qwobj : $(srcdir)/%.cpp
118 $(COMPILE.cc) -o $@ $<
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# @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1'
129# @$(SHELL) -ec '$(GEN_DEPS.c) -f $*.u $< > /dev/null 2>&1'
130
131%.u : $(srcdir)/%.cpp
132 @echo "generating dependency information for $<"
133# @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1'
134# @$(SHELL) -ec '$(GEN_DEPS.cc) -f $*.u $< > /dev/null 2>&1'
135
136## End OS400-specific setup