michael@0: # -*- makefile -*- michael@0: # vim:set ts=8 sw=8 sts=8 noet: michael@0: # michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: ifdef EXPORT_LIBRARY michael@0: ifeq ($(EXPORT_LIBRARY),1) michael@0: ifdef IS_COMPONENT michael@0: EXPORT_LIBRARY = $(DEPTH)/staticlib/components michael@0: else michael@0: EXPORT_LIBRARY = $(DEPTH)/staticlib michael@0: endif michael@0: else michael@0: # If EXPORT_LIBRARY has a value, we'll be installing there. We also need to cleanup there michael@0: GARBAGE += $(foreach lib,$(LIBRARY),$(EXPORT_LIBRARY)/$(lib)) michael@0: endif michael@0: endif # EXPORT_LIBRARY michael@0: michael@0: binaries libs:: $(SUBMAKEFILES) $(TARGETS) michael@0: ifndef NO_DIST_INSTALL michael@0: ifdef SHARED_LIBRARY michael@0: ifdef IS_COMPONENT michael@0: $(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(FINAL_TARGET)/components michael@0: ifndef NO_COMPONENTS_MANIFEST michael@0: $(call py_action,buildlist,$(FINAL_TARGET)/chrome.manifest 'manifest components/components.manifest') michael@0: $(call py_action,buildlist,$(FINAL_TARGET)/components/components.manifest 'binary-component $(SHARED_LIBRARY)') michael@0: endif michael@0: endif # IS_COMPONENT michael@0: endif # SHARED_LIBRARY michael@0: endif # !NO_DIST_INSTALL michael@0: michael@0: ifndef NO_DIST_INSTALL michael@0: michael@0: ifneq (,$(strip $(PROGRAM)$(SIMPLE_PROGRAMS))) michael@0: PROGRAMS_EXECUTABLES = $(SIMPLE_PROGRAMS) $(PROGRAM) michael@0: PROGRAMS_DEST ?= $(FINAL_TARGET) michael@0: PROGRAMS_TARGET := binaries libs michael@0: INSTALL_TARGETS += PROGRAMS michael@0: endif michael@0: michael@0: ifdef LIBRARY michael@0: ifdef EXPORT_LIBRARY michael@0: LIBRARY_FILES = $(LIBRARY) michael@0: LIBRARY_DEST ?= $(EXPORT_LIBRARY) michael@0: LIBRARY_TARGET = binaries libs michael@0: INSTALL_TARGETS += LIBRARY michael@0: endif michael@0: ifdef DIST_INSTALL michael@0: ifdef IS_COMPONENT michael@0: $(error Shipping static component libs makes no sense.) michael@0: else michael@0: DIST_LIBRARY_FILES = $(LIBRARY) michael@0: DIST_LIBRARY_DEST ?= $(DIST)/lib michael@0: DIST_LIBRARY_TARGET = binaries libs michael@0: INSTALL_TARGETS += DIST_LIBRARY michael@0: endif michael@0: endif # DIST_INSTALL michael@0: endif # LIBRARY michael@0: michael@0: michael@0: ifdef SHARED_LIBRARY michael@0: ifndef IS_COMPONENT michael@0: SHARED_LIBRARY_FILES = $(SHARED_LIBRARY) michael@0: SHARED_LIBRARY_DEST ?= $(FINAL_TARGET) michael@0: SHARED_LIBRARY_TARGET = binaries libs michael@0: INSTALL_TARGETS += SHARED_LIBRARY michael@0: michael@0: ifneq (,$(filter WINNT,$(OS_ARCH))) michael@0: ifndef NO_INSTALL_IMPORT_LIBRARY michael@0: IMPORT_LIB_FILES = $(IMPORT_LIBRARY) michael@0: endif # NO_INSTALL_IMPORT_LIBRARY michael@0: else michael@0: IMPORT_LIB_FILES = $(SHARED_LIBRARY) michael@0: endif michael@0: michael@0: IMPORT_LIB_DEST ?= $(DIST)/lib michael@0: IMPORT_LIB_TARGET = binaries libs michael@0: ifdef IMPORT_LIB_FILES michael@0: INSTALL_TARGETS += IMPORT_LIB michael@0: endif michael@0: michael@0: endif # ! IS_COMPONENT michael@0: endif # SHARED_LIBRARY michael@0: michael@0: ifneq (,$(strip $(HOST_SIMPLE_PROGRAMS)$(HOST_PROGRAM))) michael@0: HOST_PROGRAMS_EXECUTABLES = $(HOST_SIMPLE_PROGRAMS) $(HOST_PROGRAM) michael@0: HOST_PROGRAMS_DEST ?= $(DIST)/host/bin michael@0: HOST_PROGRAMS_TARGET = binaries libs michael@0: INSTALL_TARGETS += HOST_PROGRAMS michael@0: endif michael@0: michael@0: ifdef HOST_LIBRARY michael@0: HOST_LIBRARY_FILES = $(HOST_LIBRARY) michael@0: HOST_LIBRARY_DEST ?= $(DIST)/host/lib michael@0: HOST_LIBRARY_TARGET = binaries libs michael@0: INSTALL_TARGETS += HOST_LIBRARY michael@0: endif michael@0: michael@0: endif # !NO_DIST_INSTALL michael@0: michael@0: ifdef MOZ_PSEUDO_DERECURSE michael@0: BINARIES_INSTALL_TARGETS := $(foreach category,$(INSTALL_TARGETS),$(if $(filter binaries,$($(category)_TARGET)),$(category))) michael@0: michael@0: # Fill a dependency file with all the binaries installed somewhere in $(DIST) michael@0: # and with dependencies on the relevant backend files. michael@0: BINARIES_PP := $(MDDEPDIR)/binaries.pp michael@0: michael@0: $(BINARIES_PP): Makefile $(wildcard backend.mk) $(call mkdir_deps,$(MDDEPDIR)) michael@0: @echo '$(strip $(foreach category,$(BINARIES_INSTALL_TARGETS),\ michael@0: $(foreach file,$($(category)_FILES) $($(category)_EXECUTABLES),\ michael@0: $($(category)_DEST)/$(notdir $(file)): $(file)%\ michael@0: )\ michael@0: ))binaries: Makefile $(wildcard backend.mk)' | tr % '\n' > $@ michael@0: michael@0: else michael@0: binaries:: michael@0: $(error The binaries target is not supported without MOZ_PSEUDO_DERECURSE) michael@0: endif michael@0: michael@0: # EOF