]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | ## -*-makefile-*- |
2 | ## HP/UX-specific setup using CC | |
3 | ## Copyright (c) 1999-2000, International Business Machines Corporation and | |
4 | ## others. All Rights Reserved. | |
5 | ## | |
6 | ## $Id: mh-hpux-cc,v 1.1.1.1 2003/02/05 21:31:17 avery Exp $ | |
7 | ||
8 | ||
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 | |
13 | ||
14 | ## Commands to generate dependency files | |
15 | GEN_DEPS.c= : | |
16 | GEN_DEPS.cc= : | |
17 | ||
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 | |
21 | ||
22 | ## Commands to link | |
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 | |
28 | ||
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 | |
33 | ||
34 | ## Compiler switch to embed a runtime search path | |
35 | LD_RPATH= -Wl,+b, | |
36 | LD_RPATH_PRE= | |
37 | ||
38 | ## Environment variable to set a runtime search path | |
39 | LDLIBRARYPATH_ENVVAR = SHLIB_PATH | |
40 | ||
41 | ## Compiler switch to embed a library name | |
42 | LD_SONAME = -Wl,+h,$(MIDDLE_SO_TARGET) | |
43 | ||
44 | ## Shared object suffix | |
45 | SO= sl | |
46 | ## Non-shared intermediate object suffix | |
47 | STATIC_O = o | |
48 | ||
49 | ## Compilation rules | |
50 | %.$(STATIC_O): $(srcdir)/%.c | |
51 | $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< | |
52 | %.o: $(srcdir)/%.c | |
53 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< | |
54 | ||
55 | %.$(STATIC_O): $(srcdir)/%.cpp | |
56 | $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< | |
57 | %.o: $(srcdir)/%.cpp | |
58 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< | |
59 | ||
60 | ../data/%.o: ../data/%.c | |
61 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< | |
62 | ||
63 | ## Dependency rules | |
64 | %.d : $(srcdir)/%.c | |
65 | @echo "generating dependency information for $<" | |
66 | @$(GEN_DEPS.c) $< > $@ | |
67 | ||
68 | %.d : $(srcdir)/%.cpp | |
69 | @echo "generating dependency information for $<" | |
70 | @$(GEN_DEPS.cc) $< > $@ | |
71 | ||
72 | ## Versioned libraries rules | |
73 | ||
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) $@ | |
78 | ||
79 | ## End HP/UX-specific setup | |
80 |