]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | ## -*-makefile-*- |
2 | ## FreeBSD-specific setup | |
3 | ## Copyright (c) 1999-2000, International Business Machines Corporation and | |
4 | ## others. All Rights Reserved. | |
5 | ## | |
6 | ## $Id: mh-bsd-gcc,v 1.1.1.1 2003/02/05 21:31:17 avery Exp $ | |
7 | ||
8 | ## Commands to generate dependency files | |
9 | GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS) | |
10 | GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) | |
11 | ||
12 | ## Flags for position independent code | |
13 | SHAREDLIBCFLAGS = -fPIC | |
14 | SHAREDLIBCXXFLAGS = -fPIC | |
15 | SHAREDLIBCPPFLAGS = -DPIC | |
16 | ||
17 | ## Compiler switch to embed a runtime search path | |
18 | LD_RPATH= | |
19 | LD_RPATH_PRE= -Wl,-rpath, | |
20 | ||
21 | ## Compiler switch to embed a library name | |
22 | LD_SONAME = -Wl,-soname -Wl,$(MIDDLE_SO_TARGET) | |
23 | ||
24 | ## Shared object suffix | |
25 | SO = so | |
26 | ## Non-shared intermediate object suffix | |
27 | STATIC_O = ao | |
28 | ||
29 | ## Compilation rules | |
30 | %.$(STATIC_O): $(srcdir)/%.c | |
31 | $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< | |
32 | %.o: $(srcdir)/%.c | |
33 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< | |
34 | ||
35 | %.$(STATIC_O): $(srcdir)/%.cpp | |
36 | $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< | |
37 | %.o: $(srcdir)/%.cpp | |
38 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< | |
39 | ||
40 | ../data/%.o: ../data/%.c | |
41 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< | |
42 | ||
43 | ## Dependency rules | |
44 | %.d: $(srcdir)/%.c | |
45 | @echo "generating dependency information for $<" | |
46 | @$(SHELL) -ec '$(GEN_DEPS.c) $< \ | |
47 | | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ | |
48 | [ -s $@ ] || rm -f $@' | |
49 | ||
50 | %.d: $(srcdir)/%.cpp | |
51 | @echo "generating dependency information for $<" | |
52 | @$(SHELL) -ec '$(GEN_DEPS.cc) $< \ | |
53 | | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ | |
54 | [ -s $@ ] || rm -f $@' | |
55 | ||
56 | ## Versioned libraries rules | |
57 | ||
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) $@ | |
62 | ||
63 | ## End FreeBSD-specific setup | |
64 |