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