16f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## -*-makefile-*-
26f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## haiku-specific setup
36f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Copyright (c) 2010-2012, International Business Machines Corporation and
46f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## others. All Rights Reserved.
56f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org##
66f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
76f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Commands to generate dependency files
86f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgGEN_DEPS.c=  $(CC) -E -MM $(DEFS) $(CPPFLAGS)
96f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgGEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Flags for position independent code
126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgSHAREDLIBCFLAGS = -fPIC
136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgSHAREDLIBCXXFLAGS = -fPIC
146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgSHAREDLIBCPPFLAGS = -DPIC
156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Additional flags when building libraries and with threads
176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgLIBCPPFLAGS =
186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgTHREADSCPPFLAGS =
196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#
216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgCPPFLAGS += -D__STDC_ISO_10646__ -DU_CHARSET_IS_UTF8=1
226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Compiler switch to embed a runtime search path
246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgLD_RPATH=
256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgLD_RPATH_PRE = -Wl,-rpath,
266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Compiler switch to embed a library name
286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgLD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET))
296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Shared object suffix
316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgSO = so
326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Non-shared intermediate object suffix
336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgSTATIC_O = ao
346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Compilation rules
366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org%.$(STATIC_O): $(srcdir)/%.c
376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org	$(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org%.o: $(srcdir)/%.c
396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org	$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org%.$(STATIC_O): $(srcdir)/%.cpp
426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org	$(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org%.o: $(srcdir)/%.cpp
446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org	$(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Dependency rules
486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org%.d: $(srcdir)/%.c
496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org	@echo "generating dependency information for $<"
506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org	@$(SHELL) -ec '$(GEN_DEPS.c) $< \
516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org		| sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org		[ -s $@ ] || rm -f $@'
536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org%.d: $(srcdir)/%.cpp
556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org	@echo "generating dependency information for $<"
566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org	@$(SHELL) -ec '$(GEN_DEPS.cc) $< \
576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org		| sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org		[ -s $@ ] || rm -f $@'
596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Versioned libraries rules
616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org	$(RM) $@ && ln -s ${<F} $@
646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org	$(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org##  Bind internal references
686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org# LDflags that pkgdata will use
706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgBIR_LDFLAGS= -Wl,-Bsymbolic
716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org# Dependencies [i.e. map files] for the final library
736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgBIR_DEPS=
746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org# Use LIBRARY_PATH instead of LD_LIBRARY_PATH
766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgLDLIBRARYPATH_ENVVAR= LIBRARY_PATH
776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## End haiku-specific setup
79