]>
Commit | Line | Data |
---|---|---|
1 | ## -*-makefile-*- | |
2 | ## HP/UX-specific setup using aCC | |
3 | ## Copyright (c) 1999-2004, International Business Machines Corporation and | |
4 | ## others. All Rights Reserved. | |
5 | ||
6 | ## Commands to generate dependency files | |
7 | GEN_DEPS.c= : | |
8 | GEN_DEPS.cc= : | |
9 | ||
10 | ## Flags for position independent code | |
11 | SHAREDLIBCFLAGS = +z | |
12 | SHAREDLIBCXXFLAGS = +z | |
13 | ||
14 | ## Additional flags when building libraries with threads | |
15 | ## We use this instead of -mt, which isn't available in all versions of aCC | |
16 | ## Our tools won't compile with -D_POSIX_C_SOURCE=199506L | |
17 | THREADSCPPFLAGS = -D_REENTRANT -D_THREAD_SAFE | |
18 | ||
19 | # Use Extended ANSI mode, which is useful for 64-bit numbers | |
20 | # +Olibcalls uses intrinsic functions for strlen and others | |
21 | # +W ignores some warnings | |
22 | # 495 The linkage directive is ignored for an object or function... | |
23 | # 740 Unsafe cast between pointers/references to incomplete classes... | |
24 | # 749 This operation is non-portable and potentially unsafe. | |
25 | # (Ironically the solution to fix this warning is non-portable) | |
26 | # 823 Redundant preprocessing concatenation operation results in two valid | |
27 | # preprocessing tokens. This comes from INT64_C in <inttypes.h> | |
28 | CFLAGS += +Olibcalls -Ae +ESlit | |
29 | CXXFLAGS += +Olibcalls +W495 +W740 +W749 +W823 | |
30 | ||
31 | ## Commands to compile | |
32 | COMPILE.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c | |
33 | COMPILE.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c | |
34 | ||
35 | ## Common 'default' path to ensure the sanity of users. Search the current | |
36 | ## directory, at least. | |
37 | LD_DEFAULTPATH= -Wl,+b,.:'$$'ORIGIN/ | |
38 | ||
39 | # Use SHLIB_PATH and LD_LIBRARY_PATH to locate shared libraries | |
40 | LDFLAGS += -Wl,+s $(LD_DEFAULTPATH) | |
41 | ||
42 | ## Commands to link | |
43 | ## For aCC, use the C++ linker so that __shlinit gets defined | |
44 | LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS) | |
45 | LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) | |
46 | ||
47 | ## Commands to make a shared library | |
48 | #SHLIB.c= $(LD) $(LDFLAGS) -b | |
49 | SHLIB.c= $(CXX) $(CXXFLAGS) $(LDFLAGS) -b | |
50 | SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -b | |
51 | ||
52 | ## Compiler switch to embed a runtime search path | |
53 | LD_RPATH= -Wl,+b, | |
54 | LD_RPATH_PRE= | |
55 | ||
56 | ## Environment variable to set a runtime search path | |
57 | LDLIBRARYPATH_ENVVAR = SHLIB_PATH | |
58 | ||
59 | ## Compiler switch to embed a library name | |
60 | LD_SONAME = -Wl,+h,$(notdir $(MIDDLE_SO_TARGET)) | |
61 | ||
62 | ## The type of assembly needed when pkgdata is used for generating shared libraries. | |
63 | # Commented out for now because the hp1 test machine runs out of memory. | |
64 | #GENCCODE_ASSEMBLY=-a aCC | |
65 | ||
66 | ## Shared object suffix | |
67 | SO= sl | |
68 | ## Non-shared intermediate object suffix | |
69 | STATIC_O = o | |
70 | ||
71 | ## Compilation rules | |
72 | %.$(STATIC_O): $(srcdir)/%.c | |
73 | $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< | |
74 | %.o: $(srcdir)/%.c | |
75 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< | |
76 | ||
77 | %.$(STATIC_O): $(srcdir)/%.cpp | |
78 | $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< | |
79 | %.o: $(srcdir)/%.cpp | |
80 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< | |
81 | ||
82 | ||
83 | ## Dependency rules | |
84 | %.d : $(srcdir)/%.c | |
85 | @echo "generating dependency information for $<" | |
86 | @$(GEN_DEPS.c) $< > $@ | |
87 | ||
88 | %.d : $(srcdir)/%.cpp | |
89 | @echo "generating dependency information for $<" | |
90 | @$(GEN_DEPS.cc) $< > $@ | |
91 | ||
92 | ## Versioned libraries rules | |
93 | ||
94 | %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) | |
95 | $(RM) $@ && ln -s ${<F} $@ | |
96 | %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR) | |
97 | $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@ | |
98 | ||
99 | ## Install libraries as executable | |
100 | INSTALL-L=$(INSTALL_PROGRAM) | |
101 | ||
102 | ## End HP/UX-specific setup |