## -*-makefile-*-
+## Copyright (C) 2016 and later: Unicode, Inc. and others.
+## License & terms of use: http://www.unicode.org/copyright.html
## OS400-specific setup (for cross build)
-## Copyright (c) 1999-2004, International Business Machines Corporation and
+## Copyright (c) 1999-2013, International Business Machines Corporation and
## others. All Rights Reserved.
+# This otherwise breaks on OS400 - can't find "shell"
+CURR_FULL_DIR=.
+CURR_SRCCODE_FULL_DIR=.
+
GEN_DEPS.c= $(CC1) -E -M $(DEFS) $(CPPFLAGS)
GEN_DEPS.cc= $(CXX1) -E -M $(DEFS) $(CPPFLAGS)
-DEFS+=-DOS400
THREADSCPPFLAGS = -D_MULTI_THREADED
+# put this in the environment to get threading
+THREADSENVFLAGS = QIBM_MULTI_THREADED=Y ;
+
## Commands to compile
# -qTERASPACE: large pointers
# -qPFROPT=*STRDONLY: Strings are read-only
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
+COMPILE.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c -qTERASPACE=*YES -qSTGMDL=*INHERIT -qPFROPT=*STRDONLY -qRTTIALL
+
+## ICULD program - run bldiculd.sh in icu/as_is/os400/ to build it
+ICULD=/qsys.lib/$(OUTPUTDIR).lib/iculd.pgm
## 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)
-LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS) -qOPTION='*DUPPROC *DUPVAR'
-LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -qOPTION='*DUPPROC *DUPVAR'
+LINK.c= $(ICULD) $(CXXFLAGS) $(LDFLAGS) -qOPTION='*DUPPROC *DUPVAR'
+LINK.cc= $(ICULD) $(CXXFLAGS) $(LDFLAGS) -qOPTION='*DUPPROC *DUPVAR'
## Commands to make a shared library
# -qALWLIBUPD: It allows the compiled service program to have dependencies on