• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## -*-makefile-*-
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.
7
8## Commands to generate dependency files
9GEN_DEPS.c=  $(CC) -E -MM $(DEFS) $(CPPFLAGS)
10GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) $(CXXFLAGS)
11
12## Flags for position independent code
13SHAREDLIBCFLAGS = -fPIC
14SHAREDLIBCXXFLAGS = -fPIC
15SHAREDLIBCPPFLAGS = -DPIC
16
17## Additional flags when building libraries and with threads
18THREADSCPPFLAGS = -D_REENTRANT
19LIBCPPFLAGS =
20
21## Compiler switch to embed a runtime search path
22LD_RPATH= -Wl,-zorigin,-rpath,'$$'ORIGIN
23LD_RPATH_PRE = -Wl,-rpath,
24
25## These are the library specific LDFLAGS
26LDFLAGSICUDT=-nodefaultlibs -nostdlib
27
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.
32#SH# LD_SONAME=
33
34## Shared library options
35LD_SOOPTIONS= -Wl,-Bsymbolic
36
37## Shared object suffix
38SO = so
39## Non-shared intermediate object suffix
40STATIC_O = ao
41
42## Compilation rules
43%.$(STATIC_O): $(srcdir)/%.c
44	$(call SILENT_COMPILE,$(strip $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS)) -o $@ $<)
45%.o: $(srcdir)/%.c
46	$(call SILENT_COMPILE,$(strip $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS)) -o $@ $<)
47
48%.$(STATIC_O): $(srcdir)/%.cpp
49	$(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS)) -o $@ $<)
50%.o: $(srcdir)/%.cpp
51	$(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS)) -o $@ $<)
52
53
54## Dependency rules
55%.d: $(srcdir)/%.c
56	$(call ICU_MSG,(deps)) $<
57	@$(SHELL) -ec '$(GEN_DEPS.c) $< \
58		| sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
59		[ -s $@ ] || rm -f $@'
60
61%.d: $(srcdir)/%.cpp
62	$(call ICU_MSG,(deps)) $<
63	@$(SHELL) -ec '$(GEN_DEPS.cc) $< \
64		| sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
65		[ -s $@ ] || rm -f $@'
66
67## Versioned libraries rules
68
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) $@
73
74##  Bind internal references
75
76# LDflags that pkgdata will use
77BIR_LDFLAGS= -Wl,-Bsymbolic
78
79# Dependencies [i.e. map files] for the final library
80BIR_DEPS=
81
82## Remove shared library 's'
83STATIC_PREFIX_WHEN_USED =
84STATIC_PREFIX =
85
86## End Linux-specific setup
87
88