3 ## Copyright (c) 1999-2003, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 ## Provided By: Chris McKillop <cdm@qnx.com>
8 ## $Id: mh-qnx,v 1.1.1.1 2003/07/03 18:13:33 avery Exp $
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,$(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 $@ $<
56 ../data/%.o: ../data/%.c
57 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
61 @echo "generating dependency information for $<"
62 @$(SHELL) -ec '$(GEN_DEPS.c) $< \
63 | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
64 [ -s $@ ] || rm -f $@'
67 @echo "generating dependency information for $<"
68 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
69 | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
70 [ -s $@ ] || rm -f $@'
72 ## Versioned libraries rules
74 ## QNX wants the SONAME in the shared lib to match the final "real" filename.
75 ## (to ease in packaging with QNX's native package format)
77 MIDDLE_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION_MAJOR)
78 FINAL_SO_TARGET = $(MIDDLE_SO_TARGET)
80 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
81 $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION_MAJOR) $@
82 #%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
83 # $(RM) $@ && ln -s ${<F} $@
84 #%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
85 # $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
87 ## Bind internal references
89 # LDflags that pkgdata will use
90 BIR_LDFLAGS= -Wl,-Bsymbolic
92 # CPPflags for genccode/gencmn
93 BIR_CPPFLAGS= -DU_HAVE_BIND_INTERNAL_REFERENCES
95 # Dependencies [i.e. map files] for the final library
98 ## End QNX-specific setup