2 ## HPUX/gcc specific setup
3 ## Copyright (c) 1999-2012, 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
23 # Get some handy functions defined properly
24 DEFS += -D_HPUX_SOURCE -D_POSIX_C_SOURCE=199506L
27 ## For aCC, use the C++ linker so that __shlinit gets defined
28 LINK.c= $(CXX) $(DEFS) $(LDFLAGS) -Wl,+s $(LD_DEFAULTPATH)
29 LINK.cc= $(CXX) $(DEFS) $(LDFLAGS) -Wl,+s $(LD_DEFAULTPATH)
31 ## Shared library options
32 LD_SOOPTIONS= -Wl,-Bsymbolic
34 ## Commands to make a shared library
35 SHLIB.c= $(CC) $(DEFS) $(CFLAGS) $(LDFLAGS) $(SHAREDLIBCXXFLAGS) -shared -Wl,+s $(LD_DEFAULTPATH) $(LD_SOOPTIONS)
36 SHLIB.cc= $(CXX) $(DEFS) $(CXXFLAGS) $(LDFLAGS) $(SHAREDLIBCXXFLAGS) -shared -Wl,+s $(LD_DEFAULTPATH) $(LD_SOOPTIONS)
38 ## Compiler switch to embed a runtime search path
42 ## Compiler switch to embed a library name
43 LD_SONAME = -Wl,+h,$(notdir $(MIDDLE_SO_TARGET))
45 ## Environment variable to set a runtime search path
46 LDLIBRARYPATH_ENVVAR = SHLIB_PATH
48 ## Shared object suffix
50 ## Non-shared intermediate object suffix
54 %.$(STATIC_O): $(srcdir)/%.c
55 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
57 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
59 %.$(STATIC_O): $(srcdir)/%.cpp
60 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
62 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
67 @echo "Generating dependency information for $<"
68 @$(SHELL) -ec '$(GEN_DEPS.c) $< \
69 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
70 [ -s $@ ] || rm -f $@'
73 @echo "Generating dependency information for $<"
74 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
75 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
76 [ -s $@ ] || rm -f $@'
78 ## Versioned libraries rules
80 %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
81 $(RM) $@ && ln -s ${<F} $@
82 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
83 $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
85 ## Remove shared library 's'
86 STATIC_PREFIX_WHEN_USED =
89 ## End HPUX/gcc specific setup