2 ## Solaris-specific setup using gcc
3 ## Copyright (c) 1999-2000, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 ## $Id: mh-solaris-gcc,v 1.1.1.1 2003/02/05 21:31:17 avery Exp $
8 ## Flags for position independent code
9 SHAREDLIBCFLAGS = -fPIC
10 SHAREDLIBCXXFLAGS = -fPIC
11 SHAREDLIBCPPFLAGS = -DPIC
13 ## Commands to generate dependency files
14 GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
15 GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
17 ## Commands to make a shared library
18 SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -G
19 SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -G
21 ## Compiler switch to embed a runtime search path
25 ## Compiler switch to embed a library name
26 LD_SONAME = -h $(MIDDLE_SO_TARGET)
28 ## Shared object suffix
30 ## Non-shared intermediate object suffix
34 %.$(STATIC_O): $(srcdir)/%.c
35 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
37 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
39 %.$(STATIC_O): $(srcdir)/%.cpp
40 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
42 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
44 ../data/%.o: ../data/%.c
45 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
49 @echo "generating dependency information for $<"
50 @$(SHELL) -ec '$(GEN_DEPS.c) $< \
51 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
52 [ -s $@ ] || rm -f $@'
55 @echo "generating dependency information for $<"
56 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
57 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
58 [ -s $@ ] || rm -f $@'
60 ## Versioned libraries rules
62 %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
63 $(RM) $@ && ln -s $< $@
64 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
65 $(RM) $@ && ln -s $*.$(SO).$(SO_TARGET_VERSION) $@
67 ## End Solaris-specific setup