2 ## HPUX/gcc specific setup
3 ## Copyright (c) 1999-2011, 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 # Need to override this or we will get unworking assembly
20 GENCCODE_ASSEMBLY=-a gcc
22 # Get some handy functions defined properly
23 DEFS += -D_HPUX_SOURCE -D_POSIX_C_SOURCE=199506L
26 ## For aCC, use the C++ linker so that __shlinit gets defined
27 LINK.c= $(CXX) $(DEFS) $(LDFLAGS) -Wl,+s $(LD_DEFAULTPATH)
28 LINK.cc= $(CXX) $(DEFS) $(LDFLAGS) -Wl,+s $(LD_DEFAULTPATH)
30 ## Shared library options
31 LD_SOOPTIONS= -Wl,-Bsymbolic
33 ## Commands to make a shared library
34 SHLIB.c= $(CC) $(DEFS) $(CFLAGS) $(LDFLAGS) $(SHAREDLIBCXXFLAGS) -shared -Wl,+s $(LD_DEFAULTPATH) $(LD_SOOPTIONS)
35 SHLIB.cc= $(CXX) $(DEFS) $(CXXFLAGS) $(LDFLAGS) $(SHAREDLIBCXXFLAGS) -shared -Wl,+s $(LD_DEFAULTPATH) $(LD_SOOPTIONS)
37 ## Compiler switch to embed a runtime search path
41 ## Compiler switch to embed a library name
42 LD_SONAME = -Wl,+h,$(notdir $(MIDDLE_SO_TARGET))
44 ## Environment variable to set a runtime search path
45 LDLIBRARYPATH_ENVVAR = SHLIB_PATH
47 ## Shared object suffix
49 ## Non-shared intermediate object suffix
53 %.$(STATIC_O): $(srcdir)/%.c
54 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
56 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
58 %.$(STATIC_O): $(srcdir)/%.cpp
59 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
61 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
66 @echo "Generating dependency information for $<"
67 @$(SHELL) -ec '$(GEN_DEPS.c) $< \
68 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
69 [ -s $@ ] || rm -f $@'
72 @echo "Generating dependency information for $<"
73 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
74 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
75 [ -s $@ ] || rm -f $@'
77 ## Versioned libraries rules
79 %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
80 $(RM) $@ && ln -s ${<F} $@
81 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
82 $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
84 ## Remove shared library 's'
85 STATIC_PREFIX_WHEN_USED =
88 ## End HPUX/gcc specific setup