config/makefiles/target_binaries.mk

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

michael@0 1 # -*- makefile -*-
michael@0 2 # vim:set ts=8 sw=8 sts=8 noet:
michael@0 3 #
michael@0 4 # This Source Code Form is subject to the terms of the Mozilla Public
michael@0 5 # License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 7
michael@0 8 ifdef EXPORT_LIBRARY
michael@0 9 ifeq ($(EXPORT_LIBRARY),1)
michael@0 10 ifdef IS_COMPONENT
michael@0 11 EXPORT_LIBRARY = $(DEPTH)/staticlib/components
michael@0 12 else
michael@0 13 EXPORT_LIBRARY = $(DEPTH)/staticlib
michael@0 14 endif
michael@0 15 else
michael@0 16 # If EXPORT_LIBRARY has a value, we'll be installing there. We also need to cleanup there
michael@0 17 GARBAGE += $(foreach lib,$(LIBRARY),$(EXPORT_LIBRARY)/$(lib))
michael@0 18 endif
michael@0 19 endif # EXPORT_LIBRARY
michael@0 20
michael@0 21 binaries libs:: $(SUBMAKEFILES) $(TARGETS)
michael@0 22 ifndef NO_DIST_INSTALL
michael@0 23 ifdef SHARED_LIBRARY
michael@0 24 ifdef IS_COMPONENT
michael@0 25 $(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(FINAL_TARGET)/components
michael@0 26 ifndef NO_COMPONENTS_MANIFEST
michael@0 27 $(call py_action,buildlist,$(FINAL_TARGET)/chrome.manifest 'manifest components/components.manifest')
michael@0 28 $(call py_action,buildlist,$(FINAL_TARGET)/components/components.manifest 'binary-component $(SHARED_LIBRARY)')
michael@0 29 endif
michael@0 30 endif # IS_COMPONENT
michael@0 31 endif # SHARED_LIBRARY
michael@0 32 endif # !NO_DIST_INSTALL
michael@0 33
michael@0 34 ifndef NO_DIST_INSTALL
michael@0 35
michael@0 36 ifneq (,$(strip $(PROGRAM)$(SIMPLE_PROGRAMS)))
michael@0 37 PROGRAMS_EXECUTABLES = $(SIMPLE_PROGRAMS) $(PROGRAM)
michael@0 38 PROGRAMS_DEST ?= $(FINAL_TARGET)
michael@0 39 PROGRAMS_TARGET := binaries libs
michael@0 40 INSTALL_TARGETS += PROGRAMS
michael@0 41 endif
michael@0 42
michael@0 43 ifdef LIBRARY
michael@0 44 ifdef EXPORT_LIBRARY
michael@0 45 LIBRARY_FILES = $(LIBRARY)
michael@0 46 LIBRARY_DEST ?= $(EXPORT_LIBRARY)
michael@0 47 LIBRARY_TARGET = binaries libs
michael@0 48 INSTALL_TARGETS += LIBRARY
michael@0 49 endif
michael@0 50 ifdef DIST_INSTALL
michael@0 51 ifdef IS_COMPONENT
michael@0 52 $(error Shipping static component libs makes no sense.)
michael@0 53 else
michael@0 54 DIST_LIBRARY_FILES = $(LIBRARY)
michael@0 55 DIST_LIBRARY_DEST ?= $(DIST)/lib
michael@0 56 DIST_LIBRARY_TARGET = binaries libs
michael@0 57 INSTALL_TARGETS += DIST_LIBRARY
michael@0 58 endif
michael@0 59 endif # DIST_INSTALL
michael@0 60 endif # LIBRARY
michael@0 61
michael@0 62
michael@0 63 ifdef SHARED_LIBRARY
michael@0 64 ifndef IS_COMPONENT
michael@0 65 SHARED_LIBRARY_FILES = $(SHARED_LIBRARY)
michael@0 66 SHARED_LIBRARY_DEST ?= $(FINAL_TARGET)
michael@0 67 SHARED_LIBRARY_TARGET = binaries libs
michael@0 68 INSTALL_TARGETS += SHARED_LIBRARY
michael@0 69
michael@0 70 ifneq (,$(filter WINNT,$(OS_ARCH)))
michael@0 71 ifndef NO_INSTALL_IMPORT_LIBRARY
michael@0 72 IMPORT_LIB_FILES = $(IMPORT_LIBRARY)
michael@0 73 endif # NO_INSTALL_IMPORT_LIBRARY
michael@0 74 else
michael@0 75 IMPORT_LIB_FILES = $(SHARED_LIBRARY)
michael@0 76 endif
michael@0 77
michael@0 78 IMPORT_LIB_DEST ?= $(DIST)/lib
michael@0 79 IMPORT_LIB_TARGET = binaries libs
michael@0 80 ifdef IMPORT_LIB_FILES
michael@0 81 INSTALL_TARGETS += IMPORT_LIB
michael@0 82 endif
michael@0 83
michael@0 84 endif # ! IS_COMPONENT
michael@0 85 endif # SHARED_LIBRARY
michael@0 86
michael@0 87 ifneq (,$(strip $(HOST_SIMPLE_PROGRAMS)$(HOST_PROGRAM)))
michael@0 88 HOST_PROGRAMS_EXECUTABLES = $(HOST_SIMPLE_PROGRAMS) $(HOST_PROGRAM)
michael@0 89 HOST_PROGRAMS_DEST ?= $(DIST)/host/bin
michael@0 90 HOST_PROGRAMS_TARGET = binaries libs
michael@0 91 INSTALL_TARGETS += HOST_PROGRAMS
michael@0 92 endif
michael@0 93
michael@0 94 ifdef HOST_LIBRARY
michael@0 95 HOST_LIBRARY_FILES = $(HOST_LIBRARY)
michael@0 96 HOST_LIBRARY_DEST ?= $(DIST)/host/lib
michael@0 97 HOST_LIBRARY_TARGET = binaries libs
michael@0 98 INSTALL_TARGETS += HOST_LIBRARY
michael@0 99 endif
michael@0 100
michael@0 101 endif # !NO_DIST_INSTALL
michael@0 102
michael@0 103 ifdef MOZ_PSEUDO_DERECURSE
michael@0 104 BINARIES_INSTALL_TARGETS := $(foreach category,$(INSTALL_TARGETS),$(if $(filter binaries,$($(category)_TARGET)),$(category)))
michael@0 105
michael@0 106 # Fill a dependency file with all the binaries installed somewhere in $(DIST)
michael@0 107 # and with dependencies on the relevant backend files.
michael@0 108 BINARIES_PP := $(MDDEPDIR)/binaries.pp
michael@0 109
michael@0 110 $(BINARIES_PP): Makefile $(wildcard backend.mk) $(call mkdir_deps,$(MDDEPDIR))
michael@0 111 @echo '$(strip $(foreach category,$(BINARIES_INSTALL_TARGETS),\
michael@0 112 $(foreach file,$($(category)_FILES) $($(category)_EXECUTABLES),\
michael@0 113 $($(category)_DEST)/$(notdir $(file)): $(file)%\
michael@0 114 )\
michael@0 115 ))binaries: Makefile $(wildcard backend.mk)' | tr % '\n' > $@
michael@0 116
michael@0 117 else
michael@0 118 binaries::
michael@0 119 $(error The binaries target is not supported without MOZ_PSEUDO_DERECURSE)
michael@0 120 endif
michael@0 121
michael@0 122 # EOF

mercurial