]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | ## -*-makefile-*- |
2 | ## Aix-specific setup (for Visual Age 5+) | |
374ca955 | 3 | ## Copyright (c) 1999-2004, International Business Machines Corporation and |
b75a7d8f | 4 | ## others. All Rights Reserved. |
b75a7d8f A |
5 | |
6 | ## Commands to generate dependency files | |
7 | GEN_DEPS.c= $(CC) -E -M $(DEFS) $(CPPFLAGS) | |
8 | GEN_DEPS.cc= $(CXX) -E -M $(DEFS) $(CPPFLAGS) | |
9 | ||
10 | # -qroconst make the strings readonly, which is usually the default. | |
11 | # This helps in the data library, | |
12 | # -qproto assumes all functions are prototyped (for optimization) | |
13 | CFLAGS += -qproto -qroconst | |
14 | CXXFLAGS += -qproto -qroconst | |
15 | ||
374ca955 A |
16 | # If you readd this line, you must change the SO value |
17 | #LDFLAGS += -brtl | |
b75a7d8f A |
18 | |
19 | ## We need to delete things prior to linking, or else we'll get | |
20 | ## SEVERE ERROR: output file in use .. on AIX. | |
21 | ## But, shell script version should NOT delete target as we don't | |
22 | ## have $@ in that context. (SH = only shell script, icu-config) | |
23 | AIX_PREDELETE=rm -f $@ ; | |
24 | #SH# AIX_PREDELETE= | |
25 | ||
26 | ## Commands to link | |
27 | ## We need to use the C++ linker, even when linking C programs, since | |
28 | ## our libraries contain C++ code (C++ static init not called) | |
29 | LINK.c= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS) | |
30 | LINK.cc= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS) | |
31 | ||
32 | ## Commands to make a shared library | |
33 | ## -G means -berok -brtl -bnortllib -bnosymbolic -bnoautoexp | |
34 | ## -bh:8 means halt on errors or worse. We don't display warnings about | |
35 | ## duplicate inline symbols. | |
36 | SHLIB.c= $(AIX_PREDELETE) $(CXX) -qmkshrobj -G $(LDFLAGS) | |
37 | SHLIB.cc= $(AIX_PREDELETE) $(CXX) -qmkshrobj -G $(LDFLAGS) | |
38 | ||
39 | ## Compiler switch to embed a runtime search path | |
40 | LD_RPATH= -I | |
41 | LD_RPATH_PRE= | |
42 | ||
43 | ## Environment variable to set a runtime search path | |
44 | LDLIBRARYPATH_ENVVAR = LIBPATH | |
45 | ||
46 | ## Override Versioned target for a shared library. | |
47 | FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO) | |
48 | MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) | |
49 | ||
50 | # The following is for Makefile.inc's use. | |
51 | ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR) | |
52 | ||
53 | # this one is for icudefs.mk's use | |
374ca955 | 54 | ifeq ($(ENABLE_SHARED),YES) |
b75a7d8f | 55 | SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR) |
374ca955 | 56 | endif |
b75a7d8f A |
57 | |
58 | LD_SONAME = | |
59 | ||
374ca955 A |
60 | ## The type of assembly needed when pkgdata is used for generating shared libraries. |
61 | GENCCODE_ASSEMBLY=-a xlc | |
62 | ||
b75a7d8f | 63 | ## Shared object suffix |
374ca955 A |
64 | #SO= so |
65 | # without the -brtl option, the library names use .a. AIX is funny that way. | |
66 | SO= a | |
b75a7d8f A |
67 | ## Non-shared intermediate object suffix |
68 | STATIC_O = o | |
69 | ||
70 | ## Build archive from shared object | |
71 | %.a : %.so | |
72 | $(AR) $(ARFLAGS) $@ $< | |
73 | ||
74 | ## Build import list from export list | |
75 | %.e : %.exp | |
76 | @echo "Building an import list for $<" | |
77 | @$(SHELL) -ec "echo '#! $*.a($*.so)' | cat - $< > $@" | |
78 | ||
79 | ## Compilation rules | |
80 | %.$(STATIC_O): $(srcdir)/%.c | |
81 | $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< | |
82 | %.o: $(srcdir)/%.c | |
83 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< | |
84 | ||
85 | %.$(STATIC_O): $(srcdir)/%.cpp | |
86 | $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< | |
87 | %.o: $(srcdir)/%.cpp | |
88 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< | |
89 | ||
b75a7d8f A |
90 | |
91 | ## Dependency rules | |
92 | %.d : %.u | |
93 | @$(SHELL) -ec 'cat $< \ | |
94 | | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ | |
95 | [ -s $@ ] || rm -f $@ ; rm -f $<' | |
96 | ||
97 | %.u : $(srcdir)/%.c | |
98 | @echo "generating dependency information for $<" | |
99 | @$(SHELL) -ec '$(GEN_DEPS.c) $< > /dev/null' | |
100 | ||
101 | %.u : $(srcdir)/%.cpp | |
102 | @echo "generating dependency information for $<" | |
103 | @$(SHELL) -ec '$(GEN_DEPS.cc) $< > /dev/null' | |
104 | ||
105 | ## Versioned libraries rules | |
106 | %$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO) | |
374ca955 | 107 | $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@ |
b75a7d8f | 108 | %.$(SO): %$(SO_TARGET_VERSION).$(SO) |
374ca955 | 109 | $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@ |
b75a7d8f A |
110 | |
111 | ## End Aix-specific setup |