1## -*-makefile-*-
2## Solaris-specific setup using gcc
3## Copyright (c) 1999-2006, International Business Machines Corporation and
4## others. All Rights Reserved.
5
6## Flags for position independent code
7SHAREDLIBCFLAGS = -fPIC
8SHAREDLIBCXXFLAGS = -fPIC
9SHAREDLIBCPPFLAGS = -DPIC
10
11## Commands to generate dependency files
12GEN_DEPS.c= 	$(CC) -E -MM $(DEFS) $(CPPFLAGS)
13GEN_DEPS.cc=	$(CXX) -E -MM $(DEFS) $(CPPFLAGS)
14
15## These are the library specific LDFLAGS
16LDFLAGSICUDT=-nodefaultlibs -nostdlib
17
18## Additional flags when building libraries and with threads
19THREADSCPPFLAGS = -D_REENTRANT
20
21## Compiler switch to embed a runtime search path
22LD_RPATH=	-R
23LD_RPATH_PRE=	
24
25## Compiler switch to embed a library name
26LD_SONAME = -h $(notdir $(MIDDLE_SO_TARGET))
27
28## The type of assembly needed when pkgdata is used for generating shared libraries.
29## Only use this when not on x86 Solaris.
30ifeq (strip $(GENCCODE_ASSEMBLY),)
31GENCCODE_ASSEMBLY=-a sun
32endif
33
34## Shared object suffix
35SO=		so
36## Non-shared intermediate object suffix
37STATIC_O = ao
38
39## Compilation rules
40%.$(STATIC_O): $(srcdir)/%.c
41	$(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
42%.o: $(srcdir)/%.c
43	$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
44
45%.$(STATIC_O): $(srcdir)/%.cpp
46	$(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
47%.o: $(srcdir)/%.cpp
48	$(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
49
50
51## Dependency rules
52%.d : $(srcdir)/%.c
53	@echo "generating dependency information for $<"
54	@$(SHELL) -ec '$(GEN_DEPS.c) $< \
55		| sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
56		[ -s $@ ] || rm -f $@'
57
58%.d : $(srcdir)/%.cpp
59	@echo "generating dependency information for $<"
60	@$(SHELL) -ec '$(GEN_DEPS.cc) $< \
61		| sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
62		[ -s $@ ] || rm -f $@'
63
64## Versioned libraries rules
65
66%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
67	$(RM) $@ && ln -s ${<F} $@
68%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
69	$(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
70
71## End Solaris-specific setup
72