• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## -*-makefile-*-
2## Solaris-specific setup using Sun's compilers
3## Copyright (c) 1999-2009, International Business Machines Corporation and
4## others. All Rights Reserved.
5
6## Flags for position independent code
7SHAREDLIBCFLAGS = -KPIC
8SHAREDLIBCXXFLAGS = -KPIC
9SHAREDLIBCPPFLAGS = -DPIC
10
11## Commands to generate dependency files
12GEN_DEPS.c=  $(CC) -xM $(DEFS) $(CPPFLAGS)
13GEN_DEPS.cc= $(CXX) -xM $(DEFS) $(CPPFLAGS)
14
15ifeq ($(UCLN_NO_AUTO_CLEANUP),0)
16# set up init point.
17UCLN_FINI =  ucln_fini$(TARGET_STUBNAME)_$(SO_TARGET_VERSION_MAJOR)$(ICULIBSUFFIXCNAME)
18CPPFLAGS_FINI = -DUCLN_FINI=$(UCLN_FINI)
19LDFLAGS_FINI = -zfiniarray=$(UCLN_FINI)
20
21CPPFLAGSICUUC += $(CPPFLAGS_FINI)
22LDFLAGSICUUC += $(LDFLAGS_FINI)
23CPPFLAGSICUIO += $(CPPFLAGS_FINI)
24LDFLAGSICUIO += $(LDFLAGS_FINI)
25CPPFLAGSICUI18N += $(CPPFLAGS_FINI)
26LDFLAGSICUI18N += $(LDFLAGS_FINI)
27CPPFLAGSCTESTFW += $(CPPFLAGS_FINI)
28LDFLAGSCTESTFW += $(LDFLAGS_FINI)
29
30# ICUUC, ICUIO, ICUI18N, CTESTFW
31endif
32
33# -mt means 'compiles and links a multithreaded program'
34THREADSCFLAGS += -mt
35THREADSCXXFLAGS += -mt
36
37## Commands to link
38## For Sun Workshop, use CC to link to bring in C++ runtime
39LINK.c=		$(CXX) $(CXXFLAGS) $(LDFLAGS)
40LINK.cc=	$(CXX) $(CXXFLAGS) $(LDFLAGS)
41
42## Commands to make a shared library
43SHLIB.c=	$(CC) $(CFLAGS) $(LDFLAGS) -G
44SHLIB.cc=	$(CXX) $(CXXFLAGS) $(LDFLAGS) -G
45
46## Compiler switch to embed a runtime search path
47LD_RPATH=       -R'$$'ORIGIN
48LD_RPATH_PRE=   -R
49
50#LIBRARY_PATH_PREFIX=/usr/lib/lwp:
51
52## Compiler switch to embed a library name
53LD_SONAME = -h $(notdir $(MIDDLE_SO_TARGET))
54
55## Shared object suffix
56SO=		so
57## Non-shared intermediate object suffix
58STATIC_O = o
59
60## Compilation rules
61%.$(STATIC_O): $(srcdir)/%.c
62	$(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
63%.o: $(srcdir)/%.c
64	$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
65
66%.$(STATIC_O): $(srcdir)/%.cpp
67	$(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
68%.o: $(srcdir)/%.cpp
69	$(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
70
71
72## Dependency rules
73%.d : $(srcdir)/%.c
74	@echo "generating dependency information for $<"
75	@$(GEN_DEPS.c) $< > $@
76
77%.d : $(srcdir)/%.cpp
78	@echo "generating dependency information for $<"
79	@$(GEN_DEPS.cc) $< > $@
80
81## Versioned libraries rules
82
83%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
84	$(RM) $@ && ln -s ${<F} $@
85%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
86	$(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
87
88#
89ifeq (strip $(GENCCODE_ASSEMBLY),)
90BIR_LDFLAGS=  -Wl,-M,$(NAME).map -Wl,-B,symbolic -Wl,-B,eliminate
91BIR_DEPS=   $(NAME).map
92endif
93
94## Remove shared library 's'
95STATIC_PREFIX_WHEN_USED =
96STATIC_PREFIX =
97
98## End Solaris-specific setup
99