]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | ## -*-makefile-*- |
2 | ## QNX-specific setup | |
3 | ## Copyright (c) 1999-2003, International Business Machines Corporation and | |
4 | ## others. All Rights Reserved. | |
5 | ## | |
6 | ## Provided By: Chris McKillop <cdm@qnx.com> | |
7 | ## | |
8 | ## $Id: mh-qnx,v 1.1.1.1 2003/07/03 18:13:33 avery Exp $ | |
9 | ||
10 | ||
11 | # | |
12 | # Create shared libs that "work" properly. | |
13 | # | |
14 | ||
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) | |
18 | ||
19 | ## Flags for position independent code | |
20 | SHAREDLIBCFLAGS = -shared | |
21 | SHAREDLIBCXXFLAGS = -shared | |
22 | # SHAREDLIBCPPFLAGS = -shared | |
23 | ||
24 | # | |
25 | # Always generatate PIC code. | |
26 | # | |
27 | #CPPFLAGS+=-shared | |
28 | ||
29 | ## Additional flags when building libraries and with threads | |
30 | LIBCPPFLAGS = | |
31 | THREADSCPPFLAGS = | |
32 | ||
33 | ## Compiler switch to embed a runtime search path | |
34 | LD_RPATH= | |
35 | LD_RPATH_PRE = -Wl,-rpath, | |
36 | ||
37 | ## Compiler switch to embed a library name | |
38 | LD_SONAME = -Wl,-soname -Wl,$(MIDDLE_SO_TARGET) | |
39 | ||
40 | ## Shared object suffix | |
41 | SO = so | |
42 | ## Non-shared intermediate object suffix | |
43 | STATIC_O = ao | |
44 | ||
45 | ## Compilation rules | |
46 | %.$(STATIC_O): $(srcdir)/%.c | |
47 | $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< | |
48 | %.o: $(srcdir)/%.c | |
49 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< | |
50 | ||
51 | %.$(STATIC_O): $(srcdir)/%.cpp | |
52 | $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< | |
53 | %.o: $(srcdir)/%.cpp | |
54 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< | |
55 | ||
56 | ../data/%.o: ../data/%.c | |
57 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< | |
58 | ||
59 | ## Dependency rules | |
60 | %.d: $(srcdir)/%.c | |
61 | @echo "generating dependency information for $<" | |
62 | @$(SHELL) -ec '$(GEN_DEPS.c) $< \ | |
63 | | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ | |
64 | [ -s $@ ] || rm -f $@' | |
65 | ||
66 | %.d: $(srcdir)/%.cpp | |
67 | @echo "generating dependency information for $<" | |
68 | @$(SHELL) -ec '$(GEN_DEPS.cc) $< \ | |
69 | | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ | |
70 | [ -s $@ ] || rm -f $@' | |
71 | ||
72 | ## Versioned libraries rules | |
73 | ## | |
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) | |
76 | ## | |
77 | MIDDLE_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION_MAJOR) | |
78 | FINAL_SO_TARGET = $(MIDDLE_SO_TARGET) | |
79 | ||
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) $@ | |
86 | ||
87 | ## Bind internal references | |
88 | ||
89 | # LDflags that pkgdata will use | |
90 | BIR_LDFLAGS= -Wl,-Bsymbolic | |
91 | ||
92 | # CPPflags for genccode/gencmn | |
93 | BIR_CPPFLAGS= -DU_HAVE_BIND_INTERNAL_REFERENCES | |
94 | ||
95 | # Dependencies [i.e. map files] for the final library | |
96 | BIR_DEPS= | |
97 | ||
98 | ## End QNX-specific setup | |
99 |