Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | ## -*-makefile-*- |
2 | ## HPUX/gcc specific setup | |
374ca955 | 3 | ## Copyright (c) 1999-2004, International Business Machines Corporation and |
b75a7d8f | 4 | ## others. All Rights Reserved. |
b75a7d8f A |
5 | |
6 | ## Commands to generate dependency files | |
7 | GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS) | |
8 | GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) | |
9 | ||
10 | ## Flags for position independent code | |
11 | SHAREDLIBCFLAGS = -fPIC | |
12 | SHAREDLIBCXXFLAGS = -fPIC | |
13 | SHAREDLIBCPPFLAGS = -DPIC | |
14 | ||
15 | ## Common 'default' path to ensure the sanity of users. Search the current | |
16 | ## directory, at least. | |
17 | LD_DEFAULTPATH= -Wl,+b,.:'$$'ORIGIN/ | |
18 | ||
19 | # Get some handy functions defined properly | |
20 | DEFS += -D_HPUX_SOURCE -D_POSIX_C_SOURCE=199506L | |
21 | ||
22 | ## Commands to link | |
23 | ## For aCC, use the C++ linker so that __shlinit gets defined | |
24 | LINK.c= $(CXX) $(DEFS) $(LDFLAGS) -Wl,+s $(LD_DEFAULTPATH) | |
25 | LINK.cc= $(CXX) $(DEFS) $(LDFLAGS) -Wl,+s $(LD_DEFAULTPATH) | |
26 | ||
27 | ## Commands to make a shared library | |
28 | SHLIB.c= $(CC) $(DEFS) $(CFLAGS) $(LDFLAGS) $(SHAREDLIBCXXFLAGS) -shared -Wl,+s $(LD_DEFAULTPATH) | |
29 | SHLIB.cc= $(CXX) $(DEFS) $(CXXFLAGS) $(LDFLAGS) $(SHAREDLIBCXXFLAGS) -shared -Wl,+s $(LD_DEFAULTPATH) | |
30 | ||
31 | ## Compiler switch to embed a runtime search path | |
32 | LD_RPATH= -Wl,+b, | |
33 | LD_RPATH_PRE= | |
34 | ||
35 | ## Compiler switch to embed a library name | |
374ca955 | 36 | LD_SONAME = -Wl,+h,$(notdir $(MIDDLE_SO_TARGET)) |
b75a7d8f A |
37 | |
38 | ## Environment variable to set a runtime search path | |
39 | LDLIBRARYPATH_ENVVAR = SHLIB_PATH | |
40 | ||
41 | ## Shared object suffix | |
42 | SO= sl | |
43 | ## Non-shared intermediate object suffix | |
44 | STATIC_O = o | |
45 | ||
46 | ## Compilation rules | |
47 | %.$(STATIC_O): $(srcdir)/%.c | |
48 | $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< | |
49 | %.o: $(srcdir)/%.c | |
50 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< | |
51 | ||
52 | %.$(STATIC_O): $(srcdir)/%.cpp | |
53 | $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< | |
54 | %.o: $(srcdir)/%.cpp | |
55 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< | |
56 | ||
b75a7d8f A |
57 | |
58 | ## Dependency rules | |
59 | %.d : $(srcdir)/%.c | |
60 | @echo "Generating dependency information for $<" | |
61 | @$(SHELL) -ec '$(GEN_DEPS.c) $< \ | |
62 | | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ | |
63 | [ -s $@ ] || rm -f $@' | |
64 | ||
65 | %.d : $(srcdir)/%.cpp | |
66 | @echo "Generating dependency information for $<" | |
67 | @$(SHELL) -ec '$(GEN_DEPS.cc) $< \ | |
68 | | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ | |
69 | [ -s $@ ] || rm -f $@' | |
70 | ||
71 | ## Versioned libraries rules | |
72 | ||
73 | %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) | |
374ca955 | 74 | $(RM) $@ && ln -s ${<F} $@ |
b75a7d8f | 75 | %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR) |
374ca955 | 76 | $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@ |
b75a7d8f A |
77 | |
78 | ## End HPUX/gcc specific setup | |
79 |