2 ## BSD-specific setup (FreeBSD, OpenBSD, NetBSD, *BSD)
3 ## Copyright (c) 1999-2009, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 ## Commands to generate dependency files
7 GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
8 GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
10 ## Flags for position independent code
11 SHAREDLIBCFLAGS = -fPIC
12 SHAREDLIBCXXFLAGS = -fPIC
13 SHAREDLIBCPPFLAGS = -DPIC
15 ## Additional flags when building libraries and with threads
16 THREADSCPPFLAGS = -D_REENTRANT
19 ## Compiler switch to embed a runtime search path
21 LD_RPATH_PRE= -Wl,-rpath,
23 ## Compiler switch to embed a library name
24 LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET))
26 ## Shared library options
27 LD_SOOPTIONS= -Wl,-Bsymbolic
29 ## Shared object suffix
31 ## Non-shared intermediate object suffix
35 %.$(STATIC_O): $(srcdir)/%.c
36 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
38 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
40 %.$(STATIC_O): $(srcdir)/%.cpp
41 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
43 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
48 @echo "generating dependency information for $<"
49 @$(SHELL) -ec '$(GEN_DEPS.c) $< \
50 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
51 [ -s $@ ] || rm -f $@'
54 @echo "generating dependency information for $<"
55 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
56 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
57 [ -s $@ ] || rm -f $@'
59 ## Versioned libraries rules
61 %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
62 $(RM) $@ && ln -s ${<F} $@
63 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
64 $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
66 ## End FreeBSD-specific setup