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