2 ## haiku-specific setup
3 ## Copyright (c) 2010, International Business Machines Corporation and
4 ## others. All Rights Reserved.
7 ## Commands to generate dependency files
8 GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
9 GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
11 ## Flags for position independent code
12 SHAREDLIBCFLAGS = -fPIC
13 SHAREDLIBCXXFLAGS = -fPIC
14 SHAREDLIBCPPFLAGS = -DPIC
16 ## Additional flags when building libraries and with threads
20 ## Compiler switch to embed a runtime search path
22 LD_RPATH_PRE = -Wl,-rpath,
24 ## Compiler switch to embed a library name
25 LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET))
27 ## Shared object suffix
29 ## Non-shared intermediate object suffix
33 %.$(STATIC_O): $(srcdir)/%.c
34 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
36 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
38 %.$(STATIC_O): $(srcdir)/%.cpp
39 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
41 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
46 @echo "generating dependency information for $<"
47 @$(SHELL) -ec '$(GEN_DEPS.c) $< \
48 | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
49 [ -s $@ ] || rm -f $@'
52 @echo "generating dependency information for $<"
53 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
54 | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
55 [ -s $@ ] || rm -f $@'
57 ## Versioned libraries rules
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) $@
64 ## Bind internal references
66 # LDflags that pkgdata will use
67 BIR_LDFLAGS= -Wl,-Bsymbolic
69 # Dependencies [i.e. map files] for the final library
72 # Use LIBRARY_PATH instead of LD_LIBRARY_PATH
73 LDLIBRARYPATH_ENVVAR= LIBRARY_PATH
75 ## End haiku-specific setup