• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## -*-makefile-*-
2## haiku-specific setup
3## Copyright (c) 2010, International Business Machines Corporation and
4## others. All Rights Reserved.
5##
6
7## Commands to generate dependency files
8GEN_DEPS.c=  $(CC) -E -MM $(DEFS) $(CPPFLAGS)
9GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
10
11## Flags for position independent code
12SHAREDLIBCFLAGS = -fPIC
13SHAREDLIBCXXFLAGS = -fPIC
14SHAREDLIBCPPFLAGS = -DPIC
15
16## Additional flags when building libraries and with threads
17LIBCPPFLAGS =
18THREADSCPPFLAGS =
19
20## Compiler switch to embed a runtime search path
21LD_RPATH=
22LD_RPATH_PRE = -Wl,-rpath,
23
24## Compiler switch to embed a library name
25LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET))
26
27## Shared object suffix
28SO = so
29## Non-shared intermediate object suffix
30STATIC_O = ao
31
32## Compilation rules
33%.$(STATIC_O): $(srcdir)/%.c
34        $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
35%.o: $(srcdir)/%.c
36        $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
37
38%.$(STATIC_O): $(srcdir)/%.cpp
39        $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
40%.o: $(srcdir)/%.cpp
41        $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
42
43
44## Dependency rules
45%.d: $(srcdir)/%.c
46        @echo "generating dependency information for $<"
47        @$(SHELL) -ec '$(GEN_DEPS.c) $< \
48                | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
49                [ -s $@ ] || rm -f $@'
50
51%.d: $(srcdir)/%.cpp
52        @echo "generating dependency information for $<"
53        @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
54                | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
55                [ -s $@ ] || rm -f $@'
56
57## Versioned libraries rules
58
59%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
60        $(RM) $@ && ln -s ${<F} $@
61%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
62        $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
63
64##  Bind internal references
65
66# LDflags that pkgdata will use
67BIR_LDFLAGS= -Wl,-Bsymbolic
68
69# Dependencies [i.e. map files] for the final library
70BIR_DEPS=
71
72# Use LIBRARY_PATH instead of LD_LIBRARY_PATH
73LDLIBRARYPATH_ENVVAR= LIBRARY_PATH
74
75## End haiku-specific setup
76