2 ## HPUX/gcc specific setup
3 ## Copyright (c) 1999-2001, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 ## $Id: mh-hpux-gcc,v 1.1.1.1 2003/02/05 21:31:17 avery Exp $
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 # Get some handy functions defined properly
22 DEFS += -D_HPUX_SOURCE -D_POSIX_C_SOURCE=199506L
25 ## For aCC, use the C++ linker so that __shlinit gets defined
26 LINK.c= $(CXX) $(DEFS) $(LDFLAGS) -Wl,+s $(LD_DEFAULTPATH)
27 LINK.cc= $(CXX) $(DEFS) $(LDFLAGS) -Wl,+s $(LD_DEFAULTPATH)
29 ## Commands to make a shared library
30 SHLIB.c= $(CC) $(DEFS) $(CFLAGS) $(LDFLAGS) $(SHAREDLIBCXXFLAGS) -shared -Wl,+s $(LD_DEFAULTPATH)
31 SHLIB.cc= $(CXX) $(DEFS) $(CXXFLAGS) $(LDFLAGS) $(SHAREDLIBCXXFLAGS) -shared -Wl,+s $(LD_DEFAULTPATH)
33 ## Compiler switch to embed a runtime search path
37 ## Compiler switch to embed a library name
38 LD_SONAME = -Wl,+h,$(MIDDLE_SO_TARGET)
40 ## Environment variable to set a runtime search path
41 LDLIBRARYPATH_ENVVAR = SHLIB_PATH
43 ## Shared object suffix
45 ## Non-shared intermediate object suffix
49 %.$(STATIC_O): $(srcdir)/%.c
50 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
52 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
54 %.$(STATIC_O): $(srcdir)/%.cpp
55 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
57 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
59 ../data/%.o: ../data/%.c
60 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
64 @echo "Generating dependency information for $<"
65 @$(SHELL) -ec '$(GEN_DEPS.c) $< \
66 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
67 [ -s $@ ] || rm -f $@'
70 @echo "Generating dependency information for $<"
71 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
72 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
73 [ -s $@ ] || rm -f $@'
75 ## Versioned libraries rules
77 %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
78 $(RM) $@ && ln -s $< $@
79 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
80 $(RM) $@ && ln -s $*.$(SO).$(SO_TARGET_VERSION) $@
82 ## End HPUX/gcc specific setup