config/makefiles/target_binaries.mk

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/config/makefiles/target_binaries.mk	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,122 @@
     1.4 +# -*- makefile -*-
     1.5 +# vim:set ts=8 sw=8 sts=8 noet:
     1.6 +#
     1.7 +# This Source Code Form is subject to the terms of the Mozilla Public
     1.8 +# License, v. 2.0. If a copy of the MPL was not distributed with this
     1.9 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
    1.10 +
    1.11 +ifdef EXPORT_LIBRARY
    1.12 +ifeq ($(EXPORT_LIBRARY),1)
    1.13 +ifdef IS_COMPONENT
    1.14 +EXPORT_LIBRARY = $(DEPTH)/staticlib/components
    1.15 +else
    1.16 +EXPORT_LIBRARY = $(DEPTH)/staticlib
    1.17 +endif
    1.18 +else
    1.19 +# If EXPORT_LIBRARY has a value, we'll be installing there. We also need to cleanup there
    1.20 +GARBAGE += $(foreach lib,$(LIBRARY),$(EXPORT_LIBRARY)/$(lib))
    1.21 +endif
    1.22 +endif # EXPORT_LIBRARY
    1.23 +
    1.24 +binaries libs:: $(SUBMAKEFILES) $(TARGETS)
    1.25 +ifndef NO_DIST_INSTALL
    1.26 +ifdef SHARED_LIBRARY
    1.27 +ifdef IS_COMPONENT
    1.28 +	$(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(FINAL_TARGET)/components
    1.29 +ifndef NO_COMPONENTS_MANIFEST
    1.30 +	$(call py_action,buildlist,$(FINAL_TARGET)/chrome.manifest 'manifest components/components.manifest')
    1.31 +	$(call py_action,buildlist,$(FINAL_TARGET)/components/components.manifest 'binary-component $(SHARED_LIBRARY)')
    1.32 +endif
    1.33 +endif # IS_COMPONENT
    1.34 +endif # SHARED_LIBRARY
    1.35 +endif # !NO_DIST_INSTALL
    1.36 +
    1.37 +ifndef NO_DIST_INSTALL
    1.38 +
    1.39 +ifneq (,$(strip $(PROGRAM)$(SIMPLE_PROGRAMS)))
    1.40 +PROGRAMS_EXECUTABLES = $(SIMPLE_PROGRAMS) $(PROGRAM)
    1.41 +PROGRAMS_DEST ?= $(FINAL_TARGET)
    1.42 +PROGRAMS_TARGET := binaries libs
    1.43 +INSTALL_TARGETS += PROGRAMS
    1.44 +endif
    1.45 +
    1.46 +ifdef LIBRARY
    1.47 +ifdef EXPORT_LIBRARY
    1.48 +LIBRARY_FILES = $(LIBRARY)
    1.49 +LIBRARY_DEST ?= $(EXPORT_LIBRARY)
    1.50 +LIBRARY_TARGET = binaries libs
    1.51 +INSTALL_TARGETS += LIBRARY
    1.52 +endif
    1.53 +ifdef DIST_INSTALL
    1.54 +ifdef IS_COMPONENT
    1.55 +$(error Shipping static component libs makes no sense.)
    1.56 +else
    1.57 +DIST_LIBRARY_FILES = $(LIBRARY)
    1.58 +DIST_LIBRARY_DEST ?= $(DIST)/lib
    1.59 +DIST_LIBRARY_TARGET = binaries libs
    1.60 +INSTALL_TARGETS += DIST_LIBRARY
    1.61 +endif
    1.62 +endif # DIST_INSTALL
    1.63 +endif # LIBRARY
    1.64 +
    1.65 +
    1.66 +ifdef SHARED_LIBRARY
    1.67 +ifndef IS_COMPONENT
    1.68 +SHARED_LIBRARY_FILES = $(SHARED_LIBRARY)
    1.69 +SHARED_LIBRARY_DEST ?= $(FINAL_TARGET)
    1.70 +SHARED_LIBRARY_TARGET = binaries libs
    1.71 +INSTALL_TARGETS += SHARED_LIBRARY
    1.72 +
    1.73 +ifneq (,$(filter WINNT,$(OS_ARCH)))
    1.74 +ifndef NO_INSTALL_IMPORT_LIBRARY
    1.75 +IMPORT_LIB_FILES = $(IMPORT_LIBRARY)
    1.76 +endif # NO_INSTALL_IMPORT_LIBRARY
    1.77 +else
    1.78 +IMPORT_LIB_FILES = $(SHARED_LIBRARY)
    1.79 +endif
    1.80 +
    1.81 +IMPORT_LIB_DEST ?= $(DIST)/lib
    1.82 +IMPORT_LIB_TARGET = binaries libs
    1.83 +ifdef IMPORT_LIB_FILES
    1.84 +INSTALL_TARGETS += IMPORT_LIB
    1.85 +endif
    1.86 +
    1.87 +endif # ! IS_COMPONENT
    1.88 +endif # SHARED_LIBRARY
    1.89 +
    1.90 +ifneq (,$(strip $(HOST_SIMPLE_PROGRAMS)$(HOST_PROGRAM)))
    1.91 +HOST_PROGRAMS_EXECUTABLES = $(HOST_SIMPLE_PROGRAMS) $(HOST_PROGRAM)
    1.92 +HOST_PROGRAMS_DEST ?= $(DIST)/host/bin
    1.93 +HOST_PROGRAMS_TARGET = binaries libs
    1.94 +INSTALL_TARGETS += HOST_PROGRAMS
    1.95 +endif
    1.96 +
    1.97 +ifdef HOST_LIBRARY
    1.98 +HOST_LIBRARY_FILES = $(HOST_LIBRARY)
    1.99 +HOST_LIBRARY_DEST ?= $(DIST)/host/lib
   1.100 +HOST_LIBRARY_TARGET = binaries libs
   1.101 +INSTALL_TARGETS += HOST_LIBRARY
   1.102 +endif
   1.103 +
   1.104 +endif # !NO_DIST_INSTALL
   1.105 +
   1.106 +ifdef MOZ_PSEUDO_DERECURSE
   1.107 +BINARIES_INSTALL_TARGETS := $(foreach category,$(INSTALL_TARGETS),$(if $(filter binaries,$($(category)_TARGET)),$(category)))
   1.108 +
   1.109 +# Fill a dependency file with all the binaries installed somewhere in $(DIST)
   1.110 +# and with dependencies on the relevant backend files.
   1.111 +BINARIES_PP := $(MDDEPDIR)/binaries.pp
   1.112 +
   1.113 +$(BINARIES_PP): Makefile $(wildcard backend.mk) $(call mkdir_deps,$(MDDEPDIR))
   1.114 +	@echo '$(strip $(foreach category,$(BINARIES_INSTALL_TARGETS),\
   1.115 +		$(foreach file,$($(category)_FILES) $($(category)_EXECUTABLES),\
   1.116 +			$($(category)_DEST)/$(notdir $(file)): $(file)%\
   1.117 +		)\
   1.118 +	))binaries: Makefile $(wildcard backend.mk)' | tr % '\n' > $@
   1.119 +
   1.120 +else
   1.121 +binaries::
   1.122 +	$(error The binaries target is not supported without MOZ_PSEUDO_DERECURSE)
   1.123 +endif
   1.124 +
   1.125 +# EOF

mercurial