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