2 ## Copyright (C) 2016 and later: Unicode, Inc. and others.
3 ## License & terms of use: http://www.unicode.org/copyright.html
4 ## HPUX/gcc specific setup
5 ## Copyright (c) 1999-2012, International Business Machines Corporation and
6 ## others. All Rights Reserved.
8 ## Commands to generate dependency files
9 GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
10 GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
12 ## Flags for position independent code
13 SHAREDLIBCFLAGS = -fPIC
14 SHAREDLIBCXXFLAGS = -fPIC
15 SHAREDLIBCPPFLAGS = -DPIC
17 ## Common 'default' path to ensure the sanity of users. Search the current
18 ## directory, at least.
19 LD_DEFAULTPATH= -Wl,+b,.:'$$'ORIGIN/
21 # Need to override this or we will get unworking assembly
22 #GENCCODE_ASSEMBLY=-a gcc
25 # Get some handy functions defined properly
26 DEFS += -D_HPUX_SOURCE -D_POSIX_C_SOURCE=199506L
29 ## For aCC, use the C++ linker so that __shlinit gets defined
30 LINK.c= $(CXX) $(DEFS) $(LDFLAGS) -Wl,+s $(LD_DEFAULTPATH)
31 LINK.cc= $(CXX) $(DEFS) $(LDFLAGS) -Wl,+s $(LD_DEFAULTPATH)
33 ## Shared library options
34 LD_SOOPTIONS= -Wl,-Bsymbolic
36 ## Commands to make a shared library
37 SHLIB.c= $(CC) $(DEFS) $(CFLAGS) $(LDFLAGS) $(SHAREDLIBCXXFLAGS) -shared -Wl,+s $(LD_DEFAULTPATH) $(LD_SOOPTIONS)
38 SHLIB.cc= $(CXX) $(DEFS) $(CXXFLAGS) $(LDFLAGS) $(SHAREDLIBCXXFLAGS) -shared -Wl,+s $(LD_DEFAULTPATH) $(LD_SOOPTIONS)
40 ## Compiler switch to embed a runtime search path
44 ## Compiler switch to embed a library name
45 LD_SONAME = -Wl,+h,$(notdir $(MIDDLE_SO_TARGET))
47 ## Environment variable to set a runtime search path
48 LDLIBRARYPATH_ENVVAR = SHLIB_PATH
50 ## Shared object suffix
52 ## Non-shared intermediate object suffix
56 %.$(STATIC_O): $(srcdir)/%.c
57 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
59 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
61 %.$(STATIC_O): $(srcdir)/%.cpp
62 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
64 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
69 @echo "Generating dependency information for $<"
70 @$(SHELL) -ec '$(GEN_DEPS.c) $< \
71 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
72 [ -s $@ ] || rm -f $@'
75 @echo "Generating dependency information for $<"
76 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
77 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
78 [ -s $@ ] || rm -f $@'
80 ## Versioned libraries rules
82 %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
83 $(RM) $@ && ln -s ${<F} $@
84 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
85 $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
87 ## Remove shared library 's'
88 STATIC_PREFIX_WHEN_USED =
91 ## End HPUX/gcc specific setup