# for use in every library's Makefile
#
# requires the variables:
#   LIB_NAME_ROOT -- root of library's name (e.g. "libjcore-${JX_LIB_VERSION}")
#   OTHER_DEPS    -- other dependencies of target (e.g. "regex gif")

#
# default target
#

.PHONY : default
ifdef J_BUILD_SHARED_LIB
 ifdef J_NEED_SEPARATE_O_FILES
  default: ${OTHER_DEPS} ${LIB_NAME_ROOT}.so
 else
  default: ${OTHER_DEPS} all
	@-${J_STRIP_DEBUG} *.so
 endif
else
  default: ${OTHER_DEPS} ${LIB_NAME_ROOT}.a
endif
  ifneq (${J_WANT_INSTALL},0)
  ifeq (${shell whoami},root)
	@cp ${LIB_NAME_ROOT}.* ${JX_LIB_ROOT}/
  endif
  endif

#
# remove binaries
#

.PHONY : jxuninstall
jxuninstall:
  ifeq (${shell whoami},root)
	@${RM} ${JX_LIB_ROOT}/${LIB_NAME_ROOT}.*
  endif
