| 1 |
## -*-makefile-*- |
| 2 |
## Copyright (C) 2016 and later: Unicode, Inc. and others. |
| 3 |
## License & terms of use: http://www.unicode.org/copyright.html |
| 4 |
## Solaris-specific setup using gcc |
| 5 |
## Copyright (c) 1999-2014, International Business Machines Corporation and |
| 6 |
## others. All Rights Reserved. |
| 7 |
|
| 8 |
## Flags for position independent code |
| 9 |
SHAREDLIBCFLAGS = -fPIC |
| 10 |
SHAREDLIBCXXFLAGS = -fPIC |
| 11 |
SHAREDLIBCPPFLAGS = -DPIC |
| 12 |
|
| 13 |
## Commands to generate dependency files |
| 14 |
GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS) $(CFLAGS) |
| 15 |
GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) $(CXXFLAGS) |
| 16 |
|
| 17 |
## These are the library specific LDFLAGS |
| 18 |
LDFLAGSICUDT=-nodefaultlibs -nostdlib |
| 19 |
|
| 20 |
## Additional flags when building libraries and with threads |
| 21 |
THREADSCPPFLAGS = -D_REENTRANT |
| 22 |
|
| 23 |
## Compiler switch to embed a runtime search path |
| 24 |
LD_RPATH= -R'$$'ORIGIN |
| 25 |
LD_RPATH_PRE= -R |
| 26 |
|
| 27 |
## Compiler switch to embed a library name |
| 28 |
LD_SONAME = -h $(notdir $(MIDDLE_SO_TARGET)) $(PKGDATA_TRAILING_SPACE) |
| 29 |
|
| 30 |
## Shared library options |
| 31 |
LD_SOOPTIONS= -Wl,-Bsymbolic |
| 32 |
|
| 33 |
## The type of assembly needed when pkgdata is used for generating shared libraries. |
| 34 |
## Only use this when not on x86 Solaris. |
| 35 |
ifeq (strip $(GENCCODE_ASSEMBLY),) |
| 36 |
GENCCODE_ASSEMBLY=-a sun |
| 37 |
endif |
| 38 |
|
| 39 |
## Shared object suffix |
| 40 |
SO= so |
| 41 |
## Non-shared intermediate object suffix |
| 42 |
STATIC_O = ao |
| 43 |
|
| 44 |
## Compilation rules |
| 45 |
%.$(STATIC_O): $(srcdir)/%.c |
| 46 |
$(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< |
| 47 |
%.o: $(srcdir)/%.c |
| 48 |
$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< |
| 49 |
|
| 50 |
%.$(STATIC_O): $(srcdir)/%.cpp |
| 51 |
$(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< |
| 52 |
%.o: $(srcdir)/%.cpp |
| 53 |
$(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< |
| 54 |
|
| 55 |
|
| 56 |
## Dependency rules |
| 57 |
%.d : $(srcdir)/%.c |
| 58 |
@echo "generating dependency information for $<" |
| 59 |
@$(SHELL) -ec '$(GEN_DEPS.c) $< \ |
| 60 |
| sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ |
| 61 |
[ -s $@ ] || rm -f $@' |
| 62 |
|
| 63 |
%.d : $(srcdir)/%.cpp |
| 64 |
@echo "generating dependency information for $<" |
| 65 |
@$(SHELL) -ec '$(GEN_DEPS.cc) $< \ |
| 66 |
| sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ |
| 67 |
[ -s $@ ] || rm -f $@' |
| 68 |
|
| 69 |
## Versioned libraries rules |
| 70 |
|
| 71 |
%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) |
| 72 |
$(RM) $@ && ln -s ${<F} $@ |
| 73 |
%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR) |
| 74 |
$(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@ |
| 75 |
|
| 76 |
## Remove shared library 's' |
| 77 |
STATIC_PREFIX_WHEN_USED = |
| 78 |
STATIC_PREFIX = |
| 79 |
|
| 80 |
## End Solaris-specific setup |