]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | ## -*-makefile-*- |
2 | ## Solaris-specific setup using gcc | |
73c04bcf | 3 | ## Copyright (c) 1999-2006, International Business Machines Corporation and |
b75a7d8f | 4 | ## others. All Rights Reserved. |
b75a7d8f A |
5 | |
6 | ## Flags for position independent code | |
7 | SHAREDLIBCFLAGS = -fPIC | |
8 | SHAREDLIBCXXFLAGS = -fPIC | |
9 | SHAREDLIBCPPFLAGS = -DPIC | |
10 | ||
11 | ## Commands to generate dependency files | |
12 | GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS) | |
13 | GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) | |
14 | ||
73c04bcf A |
15 | ## These are the library specific LDFLAGS |
16 | LDFLAGSICUDT=-nodefaultlibs -nostdlib | |
17 | ||
18 | ## Additional flags when building libraries and with threads | |
19 | THREADSCPPFLAGS = -D_REENTRANT | |
20 | ||
b75a7d8f A |
21 | ## Compiler switch to embed a runtime search path |
22 | LD_RPATH= -R | |
23 | LD_RPATH_PRE= | |
24 | ||
25 | ## Compiler switch to embed a library name | |
374ca955 A |
26 | LD_SONAME = -h $(notdir $(MIDDLE_SO_TARGET)) |
27 | ||
28 | ## The type of assembly needed when pkgdata is used for generating shared libraries. | |
73c04bcf A |
29 | ## Only use this when not on x86 Solaris. |
30 | ifeq (strip $(GENCCODE_ASSEMBLY),) | |
374ca955 | 31 | GENCCODE_ASSEMBLY=-a sun |
73c04bcf | 32 | endif |
b75a7d8f A |
33 | |
34 | ## Shared object suffix | |
35 | SO= so | |
36 | ## Non-shared intermediate object suffix | |
37 | STATIC_O = ao | |
38 | ||
39 | ## Compilation rules | |
40 | %.$(STATIC_O): $(srcdir)/%.c | |
41 | $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< | |
42 | %.o: $(srcdir)/%.c | |
43 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< | |
44 | ||
45 | %.$(STATIC_O): $(srcdir)/%.cpp | |
46 | $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< | |
47 | %.o: $(srcdir)/%.cpp | |
48 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< | |
49 | ||
b75a7d8f A |
50 | |
51 | ## Dependency rules | |
52 | %.d : $(srcdir)/%.c | |
53 | @echo "generating dependency information for $<" | |
54 | @$(SHELL) -ec '$(GEN_DEPS.c) $< \ | |
55 | | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ | |
56 | [ -s $@ ] || rm -f $@' | |
57 | ||
58 | %.d : $(srcdir)/%.cpp | |
59 | @echo "generating dependency information for $<" | |
60 | @$(SHELL) -ec '$(GEN_DEPS.cc) $< \ | |
61 | | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ | |
62 | [ -s $@ ] || rm -f $@' | |
63 | ||
64 | ## Versioned libraries rules | |
65 | ||
66 | %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) | |
374ca955 | 67 | $(RM) $@ && ln -s ${<F} $@ |
b75a7d8f | 68 | %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR) |
374ca955 | 69 | $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@ |
b75a7d8f A |
70 | |
71 | ## End Solaris-specific setup |