2 ## IRIX-specific setup (for CC)
3 ## Copyright (c) 1999-2004, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 ## Flags for position independent code
7 SHAREDLIBCFLAGS = -shared
8 SHAREDLIBCXXFLAGS = -shared
11 ## Commands to generate dependency files
12 GEN_DEPS.c= $(CC) -E -M $(DEFS) $(CPPFLAGS)
13 GEN_DEPS.cc= $(CXX) -E -M $(DEFS) $(CPPFLAGS)
16 ## We need to use the C++ linker, even when linking C programs, since
17 ## our libraries contain C++ code (C++ static init not called)
18 #LINK.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
19 LINK.c= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS)
20 LINK.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS)
22 ## Commands to make a shared library
23 SHLIB.c= $(CC) -shared $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS)
24 SHLIB.cc= $(CXX) -shared $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS)
26 ## Additional flags when building libraries with thread safety
27 LIBCPPFLAGS = -D_REENTRANT
28 THREADSCPPFLAGS = -D_REENTRANT -D_PTHREADS
30 ## Compiler switch to embed a runtime search path
32 LD_RPATH_PRE= -Wl,-rpath,
34 ## Compiler switch to embed a library name
35 LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET))
37 ## Shared object suffix
39 ## Non-shared intermediate object suffix
43 %.$(STATIC_O): $(srcdir)/%.c
44 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
46 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
48 %.$(STATIC_O): $(srcdir)/%.cpp
49 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
51 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
56 @echo "generating dependency information for $<"
57 @$(SHELL) -ec '$(GEN_DEPS.c) $< \
58 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
59 [ -s $@ ] || rm -f $@'
62 @echo "generating dependency information for $<"
63 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
64 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
65 [ -s $@ ] || rm -f $@'
67 ## Versioned libraries rules
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) $@
74 ## End IRIX-specific setup