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