2 ## Copyright (C) 2016 and later: Unicode, Inc. and others.
3 ## License & terms of use: http://www.unicode.org/copyright.html
4 ## Linux-specific setup
5 ## Copyright (c) 1999-2013, International Business Machines Corporation and
6 ## others. All Rights Reserved.
8 ## Commands to generate dependency files
9 GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
10 GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) $(CXXFLAGS)
12 ## Flags for position independent code
13 SHAREDLIBCFLAGS = -fPIC
14 SHAREDLIBCXXFLAGS = -fPIC
15 SHAREDLIBCPPFLAGS = -DPIC
17 ## Additional flags when building libraries and with threads
18 THREADSCPPFLAGS = -D_REENTRANT
21 ## Compiler switch to embed a runtime search path
22 LD_RPATH= -Wl,-zorigin,-rpath,'$$'ORIGIN
23 LD_RPATH_PRE = -Wl,-rpath,
25 ## These are the library specific LDFLAGS
26 LDFLAGSICUDT=-nodefaultlibs -nostdlib
28 ## Compiler switch to embed a library name
29 # The initial tab in the next line is to prevent icu-config from reading it.
30 LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET))
31 #SH# # We can't depend on MIDDLE_SO_TARGET being set.
34 ## Shared library options
35 LD_SOOPTIONS= -Wl,-Bsymbolic
37 ## Shared object suffix
39 ## Non-shared intermediate object suffix
43 %.$(STATIC_O): $(srcdir)/%.c
44 $(call SILENT_COMPILE,$(strip $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS)) -o $@ $<)
46 $(call SILENT_COMPILE,$(strip $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS)) -o $@ $<)
48 %.$(STATIC_O): $(srcdir)/%.cpp
49 $(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS)) -o $@ $<)
51 $(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS)) -o $@ $<)
56 $(call ICU_MSG,(deps)) $<
57 @$(SHELL) -ec '$(GEN_DEPS.c) $< \
58 | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
59 [ -s $@ ] || rm -f $@'
62 $(call ICU_MSG,(deps)) $<
63 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
64 | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
65 [ -s $@ ] || rm -f $@'
67 ## Versioned libraries rules
69 %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
70 $(RM) $@ && ln -s ${<F} $@
71 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
72 $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
74 ## Bind internal references
76 # LDflags that pkgdata will use
77 BIR_LDFLAGS= -Wl,-Bsymbolic
79 # Dependencies [i.e. map files] for the final library
82 ## Remove shared library 's'
83 STATIC_PREFIX_WHEN_USED =
86 ## End Linux-specific setup