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.
8 ## Commands to generate dependency files
9 GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
10 GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
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
18 GENCCODE_ASSEMBLY=-a gcc
19 ## Flags for position independent code
20 SHAREDLIBCFLAGS = -qpic=large
21 SHAREDLIBCXXFLAGS = -qpic=large
22 SHAREDLIBCPPFLAGS = -DPIC
24 ## Additional flags when building libraries and with threads
25 THREADSCPPFLAGS = -D_REENTRANT
28 ## Compiler switch to embed a runtime search path
29 LD_RPATH= -Wl,-zorigin,-rpath,'$$'ORIGIN
30 #LD_RPATH_PRE = -Wl,-rpath,
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.
38 ## The type of assembly needed when pkgdata is used for generating shared libraries.
39 GENCCODE_ASSEMBLY=-a gcc
41 ## Shared object suffix
43 ## Non-shared intermediate object suffix
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)
51 %.$(STATIC_O): $(srcdir)/%.c
52 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
54 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
56 %.$(STATIC_O): $(srcdir)/%.cpp
57 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
59 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
64 @echo "generating dependency information for $<"
65 @$(SHELL) -ec '$(GEN_DEPS.c) $< > /dev/null'
68 @echo "generating dependency information for $<"
69 @$(SHELL) -ec '$(GEN_DEPS.cc) $< > /dev/null'
71 ## Versioned libraries rules
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) $@
78 ## End Linux-specific setup