1 ## -*-makefile-*- 2 ## Solaris-specific setup using gcc 3 ## Copyright (c) 1999-2010, International Business Machines Corporation and 4 ## others. All Rights Reserved. 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 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 21 ## Compiler switch to embed a runtime search path 22 LD_RPATH= -R'$$'ORIGIN 23 LD_RPATH_PRE= -R 24 25 ## Compiler switch to embed a library name 26 LD_SONAME = -h $(notdir $(MIDDLE_SO_TARGET)) 27 28 ## Shared library options 29 LD_SOOPTIONS= -Wl,-Bsymbolic 30 31 ## The type of assembly needed when pkgdata is used for generating shared libraries. 32 ## Only use this when not on x86 Solaris. 33 ifeq (strip $(GENCCODE_ASSEMBLY),) 34 GENCCODE_ASSEMBLY=-a sun 35 endif 36 37 ## Shared object suffix 38 SO= so 39 ## Non-shared intermediate object suffix 40 STATIC_O = ao 41 42 ## Compilation rules 43 %.$(STATIC_O): $(srcdir)/%.c 44 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< 45 %.o: $(srcdir)/%.c 46 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< 47 48 %.$(STATIC_O): $(srcdir)/%.cpp 49 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< 50 %.o: $(srcdir)/%.cpp 51 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< 52 53 54 ## Dependency rules 55 %.d : $(srcdir)/%.c 56 @echo "generating dependency information for $<" 57 @$(SHELL) -ec '$(GEN_DEPS.c) $< \ 58 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ 59 [ -s $@ ] || rm -f $@' 60 61 %.d : $(srcdir)/%.cpp 62 @echo "generating dependency information for $<" 63 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \ 64 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ 65 [ -s $@ ] || rm -f $@' 66 67 ## Versioned libraries rules 68 69 %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) 70 $(RM) $@ && ln -s ${<F} $@ 71 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR) 72 $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@ 73 74 ## Remove shared library 's' 75 STATIC_PREFIX_WHEN_USED = 76 STATIC_PREFIX = 77 78 ## End Solaris-specific setup 79