]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | ## -*-makefile-*- |
2 | ## Aix-specific setup (for xlC) | |
73c04bcf | 3 | ## Copyright (c) 1999-2006, International Business Machines Corporation and |
b75a7d8f A |
4 | ## others. All Rights Reserved. |
5 | ## | |
b75a7d8f A |
6 | ## Please note: AIX does NOT have library versioning per se (there is no 'SONAME' capability). |
7 | ## So, we are using 'windows' style library names, that is, libicuuc20.1.so instead of libicuuc.so.20.1 | |
8 | ||
9 | ## Commands to generate dependency files | |
10 | GEN_DEPS.c= $(CC) -E -M $(DEFS) $(CPPFLAGS) | |
11 | GEN_DEPS.cc= $(CXX) -E -M $(DEFS) $(CPPFLAGS) | |
12 | ||
13 | # Make the strings readonly. This helps in the common data library | |
14 | CFLAGS += -qroconst | |
15 | CXXFLAGS += -qroconst | |
16 | ||
17 | LDFLAGS += -brtl | |
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 | ||
27 | ## Commands to link | |
28 | ## We need to use the C++ linker, even when linking C programs, since | |
29 | ## our libraries contain C++ code (C++ static init not called) | |
30 | LINK.c= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS) | |
31 | LINK.cc= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS) | |
32 | ||
33 | ## Commands to make a shared library | |
34 | SHLIB.c= $(AIX_PREDELETE) $(AIX_SHLIB) -p 5000 $(LDFLAGS) | |
35 | SHLIB.cc= $(AIX_PREDELETE) $(AIX_SHLIB) -p 5000 $(LDFLAGS) | |
36 | ||
37 | ## Compiler switch to embed a runtime search path | |
38 | LD_RPATH= -I | |
39 | LD_RPATH_PRE= | |
40 | ||
41 | ## Environment variable to set a runtime search path | |
42 | LDLIBRARYPATH_ENVVAR = LIBPATH | |
43 | ||
44 | ## Override Versioned target for a shared library. | |
45 | FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO) | |
46 | MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) | |
47 | ||
48 | # The following is for Makefile.inc's use. | |
49 | ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR) | |
50 | ||
51 | # this one is for icudefs.mk's use | |
374ca955 | 52 | ifeq ($(ENABLE_SHARED),YES) |
b75a7d8f | 53 | SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR) |
374ca955 | 54 | endif |
b75a7d8f A |
55 | |
56 | ## Compiler switch to embed a library name. Not present on AIX. | |
57 | LD_SONAME = | |
58 | ||
59 | ## Shared object suffix | |
60 | SO= so | |
61 | ||
62 | ## Non-shared intermediate object suffix | |
63 | STATIC_O = o | |
64 | ||
65 | ## Special AIX rules | |
66 | ||
67 | ## Build archive from shared object | |
68 | %.a : %.so | |
69 | $(AR) $(ARFLAGS) $@ $< | |
70 | ||
71 | ## Build import list from export list | |
72 | %.e : %.exp | |
73 | @echo "Building an import list for $<" | |
74 | @$(SHELL) -ec "echo '#! $*.a($*.so)' | cat - $< > $@" | |
75 | ||
76 | ## Compilation rules | |
77 | %.$(STATIC_O): $(srcdir)/%.c | |
78 | $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< | |
79 | %.o: $(srcdir)/%.c | |
80 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< | |
81 | ||
82 | %.$(STATIC_O): $(srcdir)/%.cpp | |
83 | $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< | |
84 | %.o: $(srcdir)/%.cpp | |
85 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< | |
86 | ||
b75a7d8f A |
87 | |
88 | ## Dependency rules | |
89 | %.d : %.u | |
90 | @$(SHELL) -ec 'cat $< \ | |
91 | | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ | |
92 | [ -s $@ ] || rm -f $@ ; rm -f $<' | |
93 | ||
94 | %.u : $(srcdir)/%.c | |
95 | @echo "generating dependency information for $<" | |
96 | @$(SHELL) -ec '$(GEN_DEPS.c) $< > /dev/null' | |
97 | ||
98 | %.u : $(srcdir)/%.cpp | |
99 | @echo "generating dependency information for $<" | |
100 | @$(SHELL) -ec '$(GEN_DEPS.cc) $< > /dev/null' | |
101 | ||
102 | ||
103 | ## Versioned libraries rules | |
104 | %$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO) | |
374ca955 | 105 | $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@ |
b75a7d8f | 106 | %.$(SO): %$(SO_TARGET_VERSION).$(SO) |
374ca955 | 107 | $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@ |
b75a7d8f A |
108 | |
109 | ||
110 | ## BIR - bind with internal references [so app data and icu data doesn't collide] | |
111 | BIR_LDFLAGS= -E$(NAME).map -bnoexpall | |
b75a7d8f A |
112 | BIR_DEPS= $(NAME).map |
113 | ||
114 | ||
115 | ## End Aix-specific setup |