2 ## Copyright (C) 2016 and later: Unicode, Inc. and others.
3 ## License & terms of use: http://www.unicode.org/copyright.html
5 ## Copyright (c) 1999-2006, International Business Machines Corporation and
6 ## others. All Rights Reserved.
8 ## Provided By: Chris McKillop <cdm@qnx.com>
12 # Create shared libs that "work" properly.
15 ## Commands to generate dependency files
16 GEN_DEPS.c= $(CC) -E -Wp,-MM $(DEFS) $(CPPFLAGS)
17 GEN_DEPS.cc= $(CXX) -E -Wp,-MM $(DEFS) $(CPPFLAGS)
19 ## Flags for position independent code
20 SHAREDLIBCFLAGS = -shared
21 SHAREDLIBCXXFLAGS = -shared
22 # SHAREDLIBCPPFLAGS = -shared
25 # Always generatate PIC code.
29 ## Additional flags when building libraries and with threads
33 ## Compiler switch to embed a runtime search path
35 LD_RPATH_PRE = -Wl,-rpath,
37 ## Compiler switch to embed a library name
38 LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET))
40 ## Shared object suffix
42 ## Non-shared intermediate object suffix
46 %.$(STATIC_O): $(srcdir)/%.c
47 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
49 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
51 %.$(STATIC_O): $(srcdir)/%.cpp
52 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
54 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
59 @echo "generating dependency information for $<"
60 @$(SHELL) -ec '$(GEN_DEPS.c) $< \
61 | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
62 [ -s $@ ] || rm -f $@'
65 @echo "generating dependency information for $<"
66 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
67 | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
68 [ -s $@ ] || rm -f $@'
70 ## Versioned libraries rules
72 ## QNX wants the SONAME in the shared lib to match the final "real" filename.
73 ## (to ease in packaging with QNX's native package format)
75 MIDDLE_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION_MAJOR)
76 FINAL_SO_TARGET = $(MIDDLE_SO_TARGET)
78 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
79 $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION_MAJOR) $@
80 #%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
81 # $(RM) $@ && ln -s ${<F} $@
82 #%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
83 # $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
85 ## Bind internal references
87 # LDflags that pkgdata will use
88 BIR_LDFLAGS= -Wl,-Bsymbolic
90 # Dependencies [i.e. map files] for the final library
93 ## End QNX-specific setup