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