2 ## BSD-specific setup (FreeBSD, OpenBSD, NetBSD, *BSD)
3 ## Copyright (c) 1999-2006, 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 object suffix
28 ## Non-shared intermediate object suffix
32 %.$(STATIC_O): $(srcdir)/%.c
33 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
35 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
37 %.$(STATIC_O): $(srcdir)/%.cpp
38 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
40 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
45 @echo "generating dependency information for $<"
46 @$(SHELL) -ec '$(GEN_DEPS.c) $< \
47 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
48 [ -s $@ ] || rm -f $@'
51 @echo "generating dependency information for $<"
52 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
53 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
54 [ -s $@ ] || rm -f $@'
56 ## Versioned libraries rules
58 %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
59 $(RM) $@ && ln -s ${<F} $@
60 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
61 $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
63 ## End FreeBSD-specific setup