2 ## FreeBSD-specific setup
3 ## Copyright (c) 1999-2000, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 ## $Id: mh-bsd-gcc,v 1.1.1.1 2003/02/05 21:31:17 avery Exp $
8 ## Commands to generate dependency files
9 GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
10 GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
12 ## Flags for position independent code
13 SHAREDLIBCFLAGS = -fPIC
14 SHAREDLIBCXXFLAGS = -fPIC
15 SHAREDLIBCPPFLAGS = -DPIC
17 ## Compiler switch to embed a runtime search path
19 LD_RPATH_PRE= -Wl,-rpath,
21 ## Compiler switch to embed a library name
22 LD_SONAME = -Wl,-soname -Wl,$(MIDDLE_SO_TARGET)
24 ## Shared object suffix
26 ## Non-shared intermediate object suffix
30 %.$(STATIC_O): $(srcdir)/%.c
31 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
33 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
35 %.$(STATIC_O): $(srcdir)/%.cpp
36 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
38 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
40 ../data/%.o: ../data/%.c
41 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -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 $< $@
60 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
61 $(RM) $@ && ln -s $*.$(SO).$(SO_TARGET_VERSION) $@
63 ## End FreeBSD-specific setup