• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
9SHAREDLIBCFLAGS = -fPIC
10SHAREDLIBCXXFLAGS = -fPIC
11SHAREDLIBCPPFLAGS = -DPIC
12
13## Commands to generate dependency files
14GEN_DEPS.c= 	$(CC) -E -MM $(DEFS) $(CPPFLAGS) $(CFLAGS)
15GEN_DEPS.cc=	$(CXX) -E -MM $(DEFS) $(CPPFLAGS) $(CXXFLAGS)
16
17## These are the library specific LDFLAGS
18LDFLAGSICUDT=-nodefaultlibs -nostdlib
19
20## Additional flags when building libraries and with threads
21THREADSCPPFLAGS = -D_REENTRANT
22
23## Compiler switch to embed a runtime search path
24LD_RPATH=       -R'$$'ORIGIN
25LD_RPATH_PRE=   -R
26
27## Compiler switch to embed a library name
28LD_SONAME = -h $(notdir $(MIDDLE_SO_TARGET)) $(PKGDATA_TRAILING_SPACE)
29
30## Shared library options
31LD_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.
35ifeq (strip $(GENCCODE_ASSEMBLY),)
36GENCCODE_ASSEMBLY=-a sun
37endif
38
39## Shared object suffix
40SO=		so
41## Non-shared intermediate object suffix
42STATIC_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'
77STATIC_PREFIX_WHEN_USED =
78STATIC_PREFIX =
79
80## End Solaris-specific setup
81