]>
Commit | Line | Data |
---|---|---|
374ca955 A |
1 | ## -*-makefile-*- |
2 | ## Copyright (c) 2003-2004 IBM, Ken Foskey, and others. All rights reserved. | |
3 | ## | |
4 | ## Aix-specific setup (for gcc) | |
5 | ## | |
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 -MM $(DEFS) $(CPPFLAGS) | |
11 | GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) | |
12 | ||
13 | ## Commands to link | |
14 | ## We need to use the C++ linker, even when linking C programs, since | |
15 | ## our libraries contain C++ code (C++ static init not called) | |
16 | LINK.c= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS) | |
17 | LINK.cc= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS) | |
18 | ||
19 | ## Commands to make a shared library | |
20 | SHLIB.c= $(AIX_PREDELETE) $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-bexpall | |
21 | SHLIB.cc= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -Wl,-bexpall | |
22 | #SHLIB.c= $(AIX_PREDELETE) $(AIX_SHLIB) -p 5000 $(LDFLAGS) -bexpall | |
23 | #SHLIB.cc= $(AIX_PREDELETE) $(AIX_SHLIB) -p 5000 $(LDFLAGS) -bexpall | |
24 | ||
25 | ## Compiler switch to embed a runtime search path | |
26 | LD_RPATH= -I | |
27 | LD_RPATH_PRE= | |
28 | ||
29 | ## enable the shared lib loader | |
30 | LDFLAGS += -Wl,-bbigtoc | |
31 | ||
32 | ## We need to delete things prior to linking, or else we'll get | |
33 | ## SEVERE ERROR: output file in use .. on AIX. | |
34 | ## But, shell script version should NOT delete target as we don't | |
35 | ## have $@ in that context. (SH = only shell script, icu-config) | |
36 | AIX_PREDELETE=rm -f $@ ; | |
37 | #SH# AIX_PREDELETE= | |
38 | ||
39 | ## Environment variable to set a runtime search path | |
40 | LDLIBRARYPATH_ENVVAR = LIBPATH | |
41 | ||
42 | ## Override Versioned target for a shared library. | |
43 | FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO) | |
44 | MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) | |
45 | ||
46 | # The following is for Makefile.inc's use. | |
47 | ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR) | |
48 | ||
49 | # this one is for icudefs.mk's use | |
50 | ifeq ($(ENABLE_SHARED),YES) | |
51 | SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR) | |
52 | endif | |
53 | ||
54 | ## Compiler switch to embed a library name. Not present on AIX. | |
55 | LD_SONAME = | |
56 | ||
57 | ## Shared object suffix | |
58 | SO= a | |
59 | A= a | |
60 | ||
61 | ## Non-shared intermediate object suffix | |
62 | STATIC_O = o | |
63 | ||
64 | ## Special AIX rules | |
65 | ||
66 | ## Build archive from shared object | |
67 | %.a : %.so | |
68 | $(AR) $(ARFLAGS) $@ $< | |
69 | ||
70 | ## Build import list from export list | |
71 | %.e : %.exp | |
72 | @echo "Building an import list for $<" | |
73 | @$(SHELL) -ec "echo '#! $*.a($*.so)' | cat - $< > $@" | |
74 | ||
75 | ## Compilation rules | |
76 | %.$(STATIC_O): $(srcdir)/%.c | |
77 | $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< | |
78 | %.o: $(srcdir)/%.c | |
79 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< | |
80 | ||
81 | %.$(STATIC_O): $(srcdir)/%.cpp | |
82 | $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< | |
83 | %.o: $(srcdir)/%.cpp | |
84 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< | |
85 | ||
86 | ||
87 | ## Dependency rules | |
88 | %.d: $(srcdir)/%.c | |
89 | @echo "generating dependency information for $<" | |
90 | @$(SHELL) -ec '$(GEN_DEPS.c) $< \ | |
91 | | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ | |
92 | [ -s $@ ] || rm -f $@' | |
93 | ||
94 | %.d: $(srcdir)/%.cpp | |
95 | @echo "generating dependency information for $<" | |
96 | @$(SHELL) -ec '$(GEN_DEPS.cc) $< \ | |
97 | | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ | |
98 | [ -s $@ ] || rm -f $@' | |
99 | ||
100 | ## Versioned libraries rules | |
101 | %$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO) | |
102 | $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@ | |
103 | %.$(SO): %$(SO_TARGET_VERSION).$(SO) | |
104 | $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@ | |
105 | ||
106 | ||
107 | ## BIR - bind with internal references [so app data and icu data doesn't collide] | |
108 | # LDflags that pkgdata will use | |
109 | BIR_LDFLAGS= -Wl,-bE:$(NAME).map,-bnoexpall | |
110 | ||
111 | # CPPflags for genccode/gencmn | |
112 | BIR_CPPFLAGS= -DU_HAVE_BIND_INTERNAL_REFERENCES | |
113 | ||
114 | # Dependencies [i.e. map files] for the final library | |
115 | BIR_DEPS= $(NAME).map | |
116 |