| 1 |
## -*-makefile-*- |
| 2 |
## Copyright (C) 2016 and later: Unicode, Inc. and others. |
| 3 |
## License & terms of use: http://www.unicode.org/copyright.html |
| 4 |
## Linux-specific setup for Visual Age |
| 5 |
## Copyright (c) 2003-2010, International Business Machines Corporation and |
| 6 |
## others. All Rights Reserved. |
| 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 |
# -qroconst make the strings readonly, which is usually the default. |
| 13 |
# This helps in the data library, |
| 14 |
# -qproto assumes all functions are prototyped (for optimization) |
| 15 |
CFLAGS += -qproto -qroconst |
| 16 |
CXXFLAGS += -qproto -qroconst |
| 17 |
|
| 18 |
GENCCODE_ASSEMBLY=-a gcc |
| 19 |
## Flags for position independent code |
| 20 |
SHAREDLIBCFLAGS = -qpic=large |
| 21 |
SHAREDLIBCXXFLAGS = -qpic=large |
| 22 |
SHAREDLIBCPPFLAGS = -DPIC |
| 23 |
|
| 24 |
## Additional flags when building libraries and with threads |
| 25 |
THREADSCPPFLAGS = -D_REENTRANT |
| 26 |
LIBCPPFLAGS = |
| 27 |
|
| 28 |
## Compiler switch to embed a runtime search path |
| 29 |
LD_RPATH= -Wl,-zorigin,-rpath,'$$'ORIGIN |
| 30 |
#LD_RPATH_PRE = -Wl,-rpath, |
| 31 |
|
| 32 |
## Compiler switch to embed a library name |
| 33 |
# The initial tab in the next line is to prevent icu-config from reading it. |
| 34 |
LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET)) |
| 35 |
#SH# # We can't depend on MIDDLE_SO_TARGET being set. |
| 36 |
#SH# LD_SONAME= |
| 37 |
|
| 38 |
## The type of assembly needed when pkgdata is used for generating shared libraries. |
| 39 |
GENCCODE_ASSEMBLY=-a gcc |
| 40 |
|
| 41 |
## Shared object suffix |
| 42 |
SO = so |
| 43 |
## Non-shared intermediate object suffix |
| 44 |
STATIC_O = ao |
| 45 |
|
| 46 |
## Override the default mechanism for building shared objects |
| 47 |
SHLIB.c= $(CC) $(CFLAGS) -qmkshrobj -qpic=large -G $(LDFLAGS) |
| 48 |
SHLIB.cc= $(CXX) $(CXXFLAGS) -qmkshrobj -qpic=large -G $(LDFLAGS) |
| 49 |
|
| 50 |
## Compilation rules |
| 51 |
%.$(STATIC_O): $(srcdir)/%.c |
| 52 |
$(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< |
| 53 |
%.o: $(srcdir)/%.c |
| 54 |
$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< |
| 55 |
|
| 56 |
%.$(STATIC_O): $(srcdir)/%.cpp |
| 57 |
$(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< |
| 58 |
%.o: $(srcdir)/%.cpp |
| 59 |
$(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< |
| 60 |
|
| 61 |
|
| 62 |
## Dependency rules |
| 63 |
%.d: $(srcdir)/%.c |
| 64 |
@echo "generating dependency information for $<" |
| 65 |
@$(SHELL) -ec '$(GEN_DEPS.c) $< > /dev/null' |
| 66 |
|
| 67 |
%.d: $(srcdir)/%.cpp |
| 68 |
@echo "generating dependency information for $<" |
| 69 |
@$(SHELL) -ec '$(GEN_DEPS.cc) $< > /dev/null' |
| 70 |
|
| 71 |
## Versioned libraries rules |
| 72 |
|
| 73 |
%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) |
| 74 |
$(RM) $@ && ln -s ${<F} $@ |
| 75 |
%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR) |
| 76 |
$(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@ |
| 77 |
|
| 78 |
## End Linux-specific setup |
| 79 |
|