2 ## HP/UX-specific setup using CC
3 ## Copyright (c) 1999-2000, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 ## $Id: mh-hpux-cc,v 1.1.1.1 2003/02/05 21:31:17 avery Exp $
9 ## This causes source/tools/pkgdata generated makefiles to create and link
10 ## in a bogus C++ file, so that exception handling with +eh will be
11 ## enabled properly. Fun.
12 HPUX_JUNK_OBJ= $(TEMP_DIR)/hpux_junk_obj.o
14 ## Commands to generate dependency files
18 ## Commands to compile
19 COMPILE.c= $(CC) -D__STDC__ +z -Ae $(DEFS) $(CPPFLAGS) $(CFLAGS) -c
20 COMPILE.cc= $(CXX) -D__STDC__ +z -ext +dup_static_removal +d $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c
23 ## We need to use the C++ linker, even when linking C programs, since
24 ## our libraries contain C++ code (bug in linker?)
25 #LINK.c= $(CC) +z -Ae $(DEFS) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
26 LINK.c= $(CXX) +z +a1 $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -Wl,+s
27 LINK.cc= $(CXX) +z +a1 $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -Wl,+s
29 ## Commands to make a shared library
30 #SHLIB.c= $(LD) $(LDFLAGS) -b
31 SHLIB.c= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -b -Wl,+s
32 SHLIB.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -b -Wl,+s
34 ## Compiler switch to embed a runtime search path
38 ## Environment variable to set a runtime search path
39 LDLIBRARYPATH_ENVVAR = SHLIB_PATH
41 ## Compiler switch to embed a library name
42 LD_SONAME = -Wl,+h,$(MIDDLE_SO_TARGET)
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 $@ $<
60 ../data/%.o: ../data/%.c
61 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
65 @echo "generating dependency information for $<"
66 @$(GEN_DEPS.c) $< > $@
69 @echo "generating dependency information for $<"
70 @$(GEN_DEPS.cc) $< > $@
72 ## Versioned libraries rules
74 %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
75 $(RM) $@ && ln -s $< $@
76 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
77 $(RM) $@ && ln -s $*.$(SO).$(SO_TARGET_VERSION) $@
79 ## End HP/UX-specific setup