3 ## Copyright (c) 2003-2004, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 ## Original author: Andrew Bachmann
8 ## Commands to generate dependency files
9 GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
10 GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
13 #OPTIMIZATIONS= -fdefault-inline -fdefer-pop -fforce-mem -fforce-addr \
14 # -finline -finline-functions \
15 # -fkeep-inline-functions -fkeep-static-consts -fbranch-count-reg \
16 # -ffunction-cse -fstrength-reduce -fthread-jumps -fcse-follow-jumps \
17 # -fcse-skip-blocks -frerun-cse-after-loop -frerun-loop-opt \
18 # -fexpensive-optimizations -foptimize-register-move -fregmove \
19 # -fschedule-insns -fschedule-insns2 -ffloat-store -funroll-loops \
20 # -fmove-all-movables -freduce-all-givs -fpeephole \
21 # -funroll-all-loops -ffunction-sections -fdata-sections
23 # BeOS gccs (geekgadgets + 2.95.3) have this old bug:
24 # after this: const wchar_t x[] = L"foo";
25 # x[2] is "optimized" into: (wchar_t)((char *)x)[2] (== 0)
27 # see also: http://gcc.gnu.org/ml/gcc-patches/2000-09/msg00454.html
29 # Unfortunately this behavior isn't controlled by a flag so we can't
30 # use any O optimizations at all. (the behavior kicks in at -O1)
32 # Optimizations aren't currently defined in the mh files.
33 # So Don't override any flags set by the user or runConfigureICU.
34 #CFLAGS += $(OPTIMIZATIONS)
35 #CXXFLAGS += $(OPTIMIZATIONS)
37 # Use -nostart instead of -shared
38 SHLIB.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -nostart
39 SHLIB.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -nostart
41 ## Flags for position independent code
42 SHAREDLIBCFLAGS = -fPIC
43 SHAREDLIBCXXFLAGS = -fPIC
44 SHAREDLIBCPPFLAGS = -DPIC
46 ## Additional flags when building libraries and with threads
50 ## Compiler switch to embed a runtime search path
52 LD_RPATH_PRE = -Wl,-rpath,
54 ## Compiler switch to embed a library name
55 LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET))
57 ## Shared object suffix
59 ## Non-shared intermediate object suffix
63 %.$(STATIC_O): $(srcdir)/%.c
64 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
66 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
68 %.$(STATIC_O): $(srcdir)/%.cpp
69 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
71 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
76 @echo "generating dependency information for $<"
77 @$(SHELL) -ec '$(GEN_DEPS.c) $< \
78 | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
79 [ -s $@ ] || rm -f $@'
82 @echo "generating dependency information for $<"
83 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
84 | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
85 [ -s $@ ] || rm -f $@'
87 ## Versioned libraries rules
89 %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
90 $(RM) $@ && ln -s ${<F} $@
91 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
92 $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
94 ## Bind internal references
96 # LDflags that pkgdata will use
97 BIR_LDFLAGS= -Wl,-Bsymbolic
99 # CPPflags for genccode/gencmn
100 BIR_CPPFLAGS= -DU_HAVE_BIND_INTERNAL_REFERENCES
102 # Dependencies [i.e. map files] for the final library
105 # Use LIBRARY_PATH instead of LD_LIBRARY_PATH
106 LDLIBRARYPATH_ENVVAR= LIBRARY_PATH
108 ## End BeOS-specific setup