3 ## Copyright (c) 1999-2006, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 ## Provided By: Chris McKillop <cdm@qnx.com>
10 # Create shared libs that "work" properly.
13 ## Commands to generate dependency files
14 GEN_DEPS.c= $(CC) -E -Wp,-MM $(DEFS) $(CPPFLAGS)
15 GEN_DEPS.cc= $(CXX) -E -Wp,-MM $(DEFS) $(CPPFLAGS)
17 ## Flags for position independent code
18 SHAREDLIBCFLAGS = -shared
19 SHAREDLIBCXXFLAGS = -shared
20 # SHAREDLIBCPPFLAGS = -shared
23 # Always generatate PIC code.
27 ## Additional flags when building libraries and with threads
31 ## Compiler switch to embed a runtime search path
33 LD_RPATH_PRE = -Wl,-rpath,
35 ## Compiler switch to embed a library name
36 LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET))
38 ## Shared object suffix
40 ## Non-shared intermediate object suffix
44 %.$(STATIC_O): $(srcdir)/%.c
45 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
47 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
49 %.$(STATIC_O): $(srcdir)/%.cpp
50 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
52 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
57 @echo "generating dependency information for $<"
58 @$(SHELL) -ec '$(GEN_DEPS.c) $< \
59 | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
60 [ -s $@ ] || rm -f $@'
63 @echo "generating dependency information for $<"
64 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
65 | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
66 [ -s $@ ] || rm -f $@'
68 ## Versioned libraries rules
70 ## QNX wants the SONAME in the shared lib to match the final "real" filename.
71 ## (to ease in packaging with QNX's native package format)
73 MIDDLE_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION_MAJOR)
74 FINAL_SO_TARGET = $(MIDDLE_SO_TARGET)
76 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
77 $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION_MAJOR) $@
78 #%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
79 # $(RM) $@ && ln -s ${<F} $@
80 #%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
81 # $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
83 ## Bind internal references
85 # LDflags that pkgdata will use
86 BIR_LDFLAGS= -Wl,-Bsymbolic
88 # Dependencies [i.e. map files] for the final library
91 ## End QNX-specific setup