| 1 |
## -*-makefile-*- |
| 2 |
## Copyright (C) 2016 and later: Unicode, Inc. and others. |
| 3 |
## License & terms of use: http://www.unicode.org/copyright.html |
| 4 |
## IRIX-specific setup (for CC) |
| 5 |
## Copyright (c) 1999-2006, International Business Machines Corporation and |
| 6 |
## others. All Rights Reserved. |
| 7 |
|
| 8 |
## Flags for position independent code |
| 9 |
SHAREDLIBCFLAGS = -shared |
| 10 |
SHAREDLIBCXXFLAGS = -shared |
| 11 |
SHAREDLIBCPPFLAGS = |
| 12 |
|
| 13 |
## Commands to generate dependency files |
| 14 |
GEN_DEPS.c= $(CC) -E -M $(DEFS) $(CPPFLAGS) |
| 15 |
GEN_DEPS.cc= $(CXX) -E -M $(DEFS) $(CPPFLAGS) |
| 16 |
|
| 17 |
## Commands to link |
| 18 |
## We need to use the C++ linker, even when linking C programs, since |
| 19 |
## our libraries contain C++ code (C++ static init not called) |
| 20 |
#LINK.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) |
| 21 |
LINK.c= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) |
| 22 |
LINK.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) |
| 23 |
|
| 24 |
## Commands to make a shared library |
| 25 |
SHLIB.c= $(CC) -shared $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) |
| 26 |
SHLIB.cc= $(CXX) -shared $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) |
| 27 |
|
| 28 |
## Additional flags when building libraries with thread safety |
| 29 |
THREADSCPPFLAGS = -D_REENTRANT -D_PTHREADS |
| 30 |
LIBCPPFLAGS = |
| 31 |
|
| 32 |
## Compiler switch to embed a runtime search path |
| 33 |
LD_RPATH= |
| 34 |
LD_RPATH_PRE= -Wl,-rpath, |
| 35 |
|
| 36 |
## Compiler switch to embed a library name |
| 37 |
LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET)) |
| 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 |
## End IRIX-specific setup |