2 ## Copyright (C) 2016 and later: Unicode, Inc. and others.
3 ## License & terms of use: http://www.unicode.org/copyright.html
4 ## BSD-specific setup (FreeBSD, OpenBSD, NetBSD, *BSD)
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)
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
23 LD_RPATH_PRE= -Wl,-rpath,
25 ## Compiler switch to embed a library name
26 LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET))
28 ## Shared library options
29 LD_SOOPTIONS= -Wl,-Bsymbolic
31 ## Shared object suffix
33 ## Non-shared intermediate object suffix
37 %.$(STATIC_O): $(srcdir)/%.c
38 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
40 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
42 %.$(STATIC_O): $(srcdir)/%.cpp
43 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
45 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
50 @echo "generating dependency information for $<"
51 @$(SHELL) -ec '$(GEN_DEPS.c) $< \
52 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
53 [ -s $@ ] || rm -f $@'
56 @echo "generating dependency information for $<"
57 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
58 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
59 [ -s $@ ] || rm -f $@'
61 ## Versioned libraries rules
63 %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
64 $(RM) $@ && ln -s ${<F} $@
65 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
66 $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
68 ## Bind internal references
70 # LDflags that pkgdata will use
71 BIR_LDFLAGS= -Wl,-Bsymbolic
73 # Dependencies [i.e. map files] for the final library
76 ## Remove shared library 's'
77 STATIC_PREFIX_WHEN_USED =
80 ## End BSD-specific setup