2 ## HPUX/gcc specific setup
3 ## Copyright (c) 1999-2009, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 ## Commands to generate dependency files
7 GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
8 GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
10 ## Flags for position independent code
11 SHAREDLIBCFLAGS = -fPIC
12 SHAREDLIBCXXFLAGS = -fPIC
13 SHAREDLIBCPPFLAGS = -DPIC
15 ## Common 'default' path to ensure the sanity of users. Search the current
16 ## directory, at least.
17 LD_DEFAULTPATH= -Wl,+b,.:'$$'ORIGIN/
19 # Get some handy functions defined properly
20 DEFS += -D_HPUX_SOURCE -D_POSIX_C_SOURCE=199506L
23 ## For aCC, use the C++ linker so that __shlinit gets defined
24 LINK.c= $(CXX) $(DEFS) $(LDFLAGS) -Wl,+s $(LD_DEFAULTPATH)
25 LINK.cc= $(CXX) $(DEFS) $(LDFLAGS) -Wl,+s $(LD_DEFAULTPATH)
27 ## Shared library options
28 LD_SOOPTIONS= -Wl,-Bsymbolic
30 ## Commands to make a shared library
31 SHLIB.c= $(CC) $(DEFS) $(CFLAGS) $(LDFLAGS) $(SHAREDLIBCXXFLAGS) -shared -Wl,+s $(LD_DEFAULTPATH) $(LD_SOOPTIONS)
32 SHLIB.cc= $(CXX) $(DEFS) $(CXXFLAGS) $(LDFLAGS) $(SHAREDLIBCXXFLAGS) -shared -Wl,+s $(LD_DEFAULTPATH) $(LD_SOOPTIONS)
34 ## Compiler switch to embed a runtime search path
38 ## Compiler switch to embed a library name
39 LD_SONAME = -Wl,+h,$(notdir $(MIDDLE_SO_TARGET))
41 ## Environment variable to set a runtime search path
42 LDLIBRARYPATH_ENVVAR = SHLIB_PATH
44 ## Shared object suffix
46 ## Non-shared intermediate object suffix
50 %.$(STATIC_O): $(srcdir)/%.c
51 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
53 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
55 %.$(STATIC_O): $(srcdir)/%.cpp
56 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
58 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
63 @echo "Generating dependency information for $<"
64 @$(SHELL) -ec '$(GEN_DEPS.c) $< \
65 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
66 [ -s $@ ] || rm -f $@'
69 @echo "Generating dependency information for $<"
70 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
71 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
72 [ -s $@ ] || rm -f $@'
74 ## Versioned libraries rules
76 %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
77 $(RM) $@ && ln -s ${<F} $@
78 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
79 $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
81 ## Remove shared library 's'
82 STATIC_PREFIX_WHEN_USED =
85 ## End HPUX/gcc specific setup