5 kx
5 kx # include once
5 kx ifndef CORE_MK
5 kx
5 kx #######
5 kx ####### helpful variables
5 kx #######
5 kx
5 kx comma := ,
5 kx empty :=
5 kx space := $(empty) $(empty)
5 kx
5 kx
5 kx #######
5 kx ####### Set up TOP_BUILD_DIR, TOP_BUILD_DIR_ABS and BUILDSYSTEM variables
5 kx #######
5 kx
5 kx ifndef MAKEFILE_LIST
5 kx
5 kx # Work-around for GNU make pre-3.80, which lacks MAKEFILE_LIST and $(eval ...)
5 kx
5 kx TOP_BUILD_DIR := $(shell perl -e 'for ($$_ = "$(CURDIR)"; ! -d "$$_/build-system"; s!(.*)/(.*)!\1!) { $$q .= "../"; } chop $$q; print "$$q"')
5 kx ifeq ($(TOP_BUILD_DIR),)
5 kx TOP_BUILD_DIR=.
5 kx endif
5 kx export TOP_BUILD_DIR_ABS := $(shell perl -e 'for ($$_ = "$(CURDIR)"; ! -d "$$_/build-system"; s!(.*)/(.*)!\1!) { } print')
5 kx export BUILDSYSTEM := $(TOP_BUILD_DIR_ABS)/build-system
5 kx
5 kx else
5 kx
5 kx # Normal operation for GNU make 3.80 and above
5 kx
5 kx __pop = $(patsubst %/,%,$(dir $(1)))
5 kx __tmp := $(call __pop,$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
5 kx # Special case for build-system/Makefile
5 kx ifeq ($(__tmp),.)
5 kx __tmp := ../$(notdir $(CURDIR))
5 kx endif
5 kx
5 kx ifndef TOP_BUILD_DIR
5 kx TOP_BUILD_DIR := $(call __pop,$(__tmp))
5 kx endif
5 kx
5 kx ifndef TOP_BUILD_DIR_ABS
5 kx TOP_BUILD_DIR_ABS := $(CURDIR)
5 kx ifneq ($(TOP_BUILD_DIR),.)
5 kx $(foreach ,$(subst /, ,$(TOP_BUILD_DIR)),$(eval TOP_BUILD_DIR_ABS := $(call __pop,$(TOP_BUILD_DIR_ABS))))
5 kx endif
5 kx export TOP_BUILD_DIR_ABS
5 kx endif
5 kx
5 kx ifndef BUILDSYSTEM
5 kx export BUILDSYSTEM := $(TOP_BUILD_DIR_ABS)/$(notdir $(__tmp))
5 kx endif
5 kx
5 kx endif
5 kx
5 kx
5 kx PATH := $(BUILDSYSTEM):$(BUILDSYSTEM)/sbin:$(BUILDSYSTEM)/usr/bin:$(PATH)
5 kx
5 kx
5 kx #######
5 kx ####### Config:
5 kx #######
5 kx
5 kx include $(BUILDSYSTEM)/constants.mk
5 kx
5 kx #
5 kx # All available hardware:
5 kx #
5 kx HARDWARE_ALL = $(strip $(foreach hw, $(filter HARDWARE_%, \
5 kx $(filter-out HARDWARE_ALL \
5 kx HARDWARE_NAMES, \
5 kx $(.VARIABLES))), $($(hw))))
5 kx
5 kx HARDWARE_NAMES = $(filter-out $(HARDWARE_NOARCH), $(HARDWARE_ALL))
5 kx
5 kx #
5 kx # All available toolchains:
5 kx #
5 kx TOOLCHAIN_ALL = $(strip $(foreach t, $(filter TOOLCHAIN_%, \
5 kx $(filter-out TOOLCHAIN_ALL \
5 kx TOOLCHAIN_NAMES \
5 kx TOOLCHAIN_DIR \
5 kx TOOLCHAIN_PATH \
5 kx TOOLCHAIN_VERSION, \
5 kx $(.VARIABLES))), $($(t))))
5 kx
5 kx TOOLCHAIN_NAMES = $(TOOLCHAIN_ALL)
5 kx
5 kx COMPONENT_TOOLCHAINS = $(TOOLCHAIN_ALL)
5 kx
5 kx
5 kx
5 kx
5 kx #######
5 kx ####### Config:
5 kx #######
5 kx
5 kx ifneq ($(wildcard $(BUILDSYSTEM)/build-config.mk),)
5 kx include $(BUILDSYSTEM)/build-config.mk
5 kx else
5 kx include $(BUILDSYSTEM)/build-config.mk.template
5 kx endif
5 kx
5 kx # Reading build-config.mk:
5 kx
5 kx # ENABLE_NOARCH & ENABLE_BUILD always enabled:
5 kx ENABLE_NOARCH = true
5 kx ENABLE_BUILD = true
5 kx
5 kx enabled = $(filter ENABLE_%, $(filter-out ENABLE_ARCH ENABLE_TARGETS, $(.VARIABLES)))
5 kx
5 kx hardware_filter = $(strip $(foreach t, \
5 kx $(strip $(foreach b, \
5 kx $(enabled), $(if $(filter true, $($(b))), \
5 kx $(subst ENABLE_, HARDWARE_, $(b))))), $($(t))))
5 kx
5 kx # If no HARDWARE set
5 kx ifeq ($(HARDWARE),)
5 kx
5 kx # COMPONENT_TARGETS must have a value specified in the Makefile
5 kx ifeq ($(COMPONENT_TARGETS),)
5 kx $(error Error: COMPONENT_TARGETS must have a value)
5 kx endif
5 kx
5 kx # End if no HARDWARE set
5 kx endif
5 kx
5 kx
5 kx
5 kx #######
5 kx ####### Filter out disabled targets
5 kx #######
5 kx
5 kx COMPONENT_TARGETS := $(filter $(hardware_filter), $(COMPONENT_TARGETS))
5 kx
5 kx # Remove duplicates:
5 kx COMPONENT_TARGETS := $(sort $(COMPONENT_TARGETS))
5 kx
5 kx
5 kx #######
5 kx ####### Filter out disabled toolchains:
5 kx #######
5 kx
5 kx COMPONENT_TOOLCHAINS := $(strip \
5 kx $(foreach toolchain, $(COMPONENT_TOOLCHAINS), \
5 kx $(if $(filter $($(shell echo $(toolchain) | tr '[a-z-]' '[A-Z_]')_HARDWARE_VARIANTS), \
5 kx $(COMPONENT_TARGETS)),$(toolchain),)))
5 kx
5 kx COMPONENT_TOOLCHAINS := $(sort $(COMPONENT_TOOLCHAINS))
5 kx
5 kx
5 kx
5 kx # Error if TOOLCHAIN is invalid
5 kx ifneq ($(TOOLCHAIN),)
5 kx ifeq ($(filter $(TOOLCHAIN), $(COMPONENT_TOOLCHAINS)),)
5 kx $(error Error: TOOLCHAIN=$(TOOLCHAIN) is invalid for selected COMPONENT_TARGETS in Makefile)
5 kx endif
5 kx endif
5 kx
5 kx # Error if HARDWARE is invalid
5 kx ifneq ($(HARDWARE),)
5 kx ifeq ($(filter $(HARDWARE), $(COMPONENT_TARGETS)),)
5 kx $(error Error: HARDWARE=$(HARDWARE) is invalid for selected COMPONENT_TARGETS in Makefile)
5 kx endif
5 kx endif
5 kx
5 kx
5 kx ################################################################
5 kx #######
5 kx ####### Directories setup Section:
5 kx #######
5 kx
5 kx #
5 kx # Set up SOURCE PACKAGE directory:
5 kx #
5 kx export SRC_PACKAGE_DIR := sources
5 kx export SRC_PACKAGE_PATH := $(TOP_BUILD_DIR)/$(SRC_PACKAGE_DIR)
5 kx export SRC_PACKAGE_PATH_ABS := $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR)
5 kx
5 kx
5 kx #
5 kx # Set up DESTINATION directories:
5 kx #
5 kx DEST_DIR_ABS = $(TOP_BUILD_DIR_ABS)/dist
5 kx
5 kx ifeq ($(NEED_ABS_PATH),)
5 kx DEST_DIR = $(TOP_BUILD_DIR)/dist
5 kx else
5 kx DEST_DIR = $(DEST_DIR_ABS)
5 kx endif
5 kx
5 kx
5 kx #
5 kx # Default PREFIX: is $(TOP_BUILD_DIR)/dist
5 kx #
5 kx PREFIX ?= $(DEST_DIR)
5 kx
5 kx
5 kx #
5 kx # Install DIRs (for SCRIPT_, BIN_, ... TARGETS) [should be always ABS]:
5 kx #
5 kx TARGET_DEST_DIR = $(DEST_DIR_ABS)/$(addprefix ., $(TOOLCHAIN))/$(HARDWARE)
5 kx PRODUCTS_DEST_DIR = $(DEST_DIR_ABS)/products/$(TOOLCHAIN)/$(HARDWARE)
5 kx ROOTFS_DEST_DIR = $(DEST_DIR_ABS)/rootfs/$(TOOLCHAIN)/$(HARDWARE)
5 kx
5 kx #######
5 kx ####### End of Directories setup Section.
5 kx #######
5 kx ################################################################
5 kx
5 kx
5 kx
5 kx ################################################################
5 kx #######
5 kx ####### Targets setup Section:
5 kx #######
5 kx
5 kx ifdef TARGET_SETUP_MK
5 kx $(error Error: 'target-setup.mk' should not be included directly, include 'constants.mk' instead.)
5 kx endif
5 kx
5 kx include $(BUILDSYSTEM)/target-setup.mk
5 kx
5 kx #######
5 kx ####### End of Targets setup Section.
5 kx #######
5 kx ################################################################
5 kx
5 kx
5 kx
5 kx
5 kx
5 kx
5 kx
5 kx
5 kx ################################################################
5 kx # Get toolchain by HARDWARE function:
5 kx #
5 kx # toolchain()
5 kx #
5 kx toolchain = $($(strip \
5 kx $(foreach v, $(filter %_HARDWARE_VARIANTS, $(.VARIABLES)), \
5 kx $(if $(filter $1, $($(v))), \
5 kx $(addprefix TOOLCHAIN_,$(subst _HARDWARE_VARIANTS,,$(v))), \
5 kx ))))
5 kx
5 kx # usage:
5 kx # pc32_toolchain = $(call toolchain,$(HARDWARE_INTEL_PC32))
5 kx #
5 kx # Get toolchain by HARDWARE function.
5 kx ################################################################
5 kx
5 kx
5 kx ################################################################
5 kx # Check the list of available targets for current Makefile
5 kx #
5 kx __available_targets = \
5 kx $(foreach arch, $(shell echo $(COMPONENT_TOOLCHAINS) | sed -e 's/x86_64/x86-64/g'), \
5 kx $(foreach hardware, $($(shell echo ${arch} | tr '[a-z-]' '[A-Z_]')_HARDWARE_VARIANTS), \
5 kx $(if $(filter $(hardware),$(COMPONENT_TARGETS)), \
5 kx $(if $($(shell echo $(hardware) | tr '[a-z]' '[A-Z]')_FLAVOURS), \
5 kx $(foreach flavour, $($(shell echo $(hardware) | tr '[a-z]' '[A-Z]')_FLAVOURS), \
5 kx .target_$(arch)_$(hardware)_$(flavour) \
5 kx ) .target_$(arch)_$(hardware), \
5 kx $(if $(FLAVOURS), \
5 kx $(foreach flavour, $(FLAVOURS), \
5 kx .target_$(arch)_$(hardware)_$(flavour) \
5 kx ) .target_$(arch)_$(hardware), \
5 kx .target_$(arch)_$(hardware) \
5 kx ) \
5 kx ), \
5 kx ) \
5 kx ) \
5 kx )
5 kx
5 kx __available_targets := $(strip $(__available_targets))
5 kx __available_targets := $(sort $(__available_targets))
5 kx #
5 kx #
5 kx ################################################################
5 kx
5 kx
5 kx
5 kx #######
5 kx ####### Silent make:
5 kx #######
5 kx
5 kx #ifeq ($(VERBOSE),)
5 kx #ifeq ($(COMPONENT_IS_3PP),)
5 kx #MAKEFLAGS += -s
5 kx #endif
5 kx #endif
5 kx #
5 kx #ifeq ($(VERBOSE),)
5 kx #guiet = @
5 kx #else
5 kx #quiet =
5 kx #endif
5 kx
5 kx
5 kx #######
5 kx ####### Number of CPU cores:
5 kx #######
5 kx
5 kx NUMPROCS := 1
5 kx OS := $(shell uname -s)
5 kx
5 kx ifeq ($(OS),Linux)
5 kx NUMPROCS := $(shell grep -c ^processor /proc/cpuinfo)
5 kx endif
5 kx
5 kx
5 kx #######
5 kx ####### Parallel control:
5 kx #######
5 kx
5 kx ifneq ($(NOT_PARALLEL),)
5 kx MAKEFLAGS += -j1
5 kx .NOTPARALLEL:
5 kx endif
5 kx
5 kx
5 kx
5 kx #######
5 kx ####### Global Cleanup List may be start here with += assign symbol:
5 kx #######
5 kx ####### CLEANUP_FILES += ...
5 kx #######
5 kx ####### IMPORTANT NOTE:
5 kx ####### ==============
5 kx ####### Do not add directories such as .$(TOOLCHAIN), $(TARGET_BUILD_DIR), $(HARDWARE), etc.
5 kx #######
5 kx
5 kx
5 kx
5 kx all: BUILD_TREE := true
5 kx export BUILD_TREE
5 kx
5 kx all:
5 kx @$(MAKE) local_all
5 kx
5 kx
5 kx clean: CLEAN_TREE := true
5 kx export CLEAN_TREE
5 kx
5 kx clean:
5 kx @$(MAKE) local_clean
5 kx
5 kx
5 kx dist_clean: DIST_CLEAN_TREE := true
5 kx export DIST_CLEAN_TREE
5 kx
5 kx dist_clean:
5 kx @$(MAKE) local_dist_clean
5 kx
5 kx
5 kx rootfs_clean: ROOTFS_CLEAN_TREE := true
5 kx export ROOTFS_CLEAN_TREE
5 kx
5 kx rootfs_clean:
5 kx @$(MAKE) local_rootfs_clean
5 kx
5 kx
5 kx
5 kx
5 kx # MAKE goals which not depended from Makefile
5 kx __quick_targets := help ccache_stats ccache_cleanup configure_targets local_clean global_clean downloads_clean build-config.mk $(HACK_TARGETS)
5 kx
5 kx
5 kx
5 kx
5 kx ################################################################
5 kx #######
5 kx ####### Build preparations & HW Independed GOALs Section:
5 kx #######
5 kx
5 kx #
5 kx # GLOBAL setup targets:
5 kx # ====================
5 kx # These targets are built before all targets. For example, source tarballs
5 kx # have to be downloaded before starting the build.
5 kx #
5 kx # NOTE:
5 kx # BUILDSYSTEM is a setup target for other directories and the BUILDSYSTEM
5 kx # requires only '.sources' target as a setup target.
5 kx #
5 kx ifeq ($(filter %_clean,$(MAKECMDGOALS)),)
5 kx ifeq ($(shell pwd),$(BUILDSYSTEM))
5 kx __setup_targets = .sources
5 kx else
5 kx __setup_targets = .sources .build_system
5 kx endif
5 kx endif
5 kx
5 kx
5 kx .setup:
5 kx ifeq ($(__final__),)
5 kx .setup: $(__setup_targets)
5 kx else
5 kx .setup: .makefile
5 kx endif
5 kx
5 kx
5 kx #######
5 kx ####### If Makefile has been changed we cannot warranty that this is afected only
5 kx ####### one HW target from the list of targets prepared by this local Makefile.
5 kx #######
5 kx ####### So, in this case we have to clean up all built targets.
5 kx #######
5 kx
5 kx # Check if Makefile has been changed:
5 kx .makefile: Makefile
5 kx ifneq ($(shell pwd),$(TOP_BUILD_DIR_ABS))
5 kx ifneq ($(if $(MAKECMDGOALS),$(filter-out $(__quick_targets),$(MAKECMDGOALS)),true),)
5 kx @touch $@
5 kx ifeq ($(shell pwd | grep $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR))$(shell pwd | grep $(BUILDSYSTEM)/3pp/sources),)
5 kx @echo ""
5 kx @echo -e "#######"
5 kx @echo -e "####### New makefile ($(<F)), clean up & rebuild source requires!"
5 kx @echo -e "#######"
5 kx @echo ""
5 kx @$(MAKE) local_dist_clean
5 kx @if $(MAKE) local_clean; then true; else rm -f $@; fi
5 kx else
5 kx @if $(MAKE) download_clean; then true; else rm -f $@; fi
5 kx endif
5 kx endif
5 kx endif
5 kx
5 kx
5 kx
5 kx #######
5 kx ####### Build directory dependencies into .src_requires which
5 kx ####### is used as a Makefile for srource tarballs downloading
5 kx #######
5 kx
5 kx #######
5 kx ####### NOTE:
5 kx ####### ====
5 kx ####### Source tarballs are downloaded once for whole dependencies tree
5 kx ####### of the current directory where we make the build using command
5 kx ####### such as 'make' or 'make local_all'.
5 kx ####### Target local_all is not affects the downloading sources for the
5 kx ####### whole dependencies tree (target local_all affects the building
5 kx ####### of packages only).
5 kx ####### In this case the $(__final__) variable is not defined.
5 kx ####### On the contrary when the BUILDSYSTEM builds each packages of
5 kx ####### dependencies tree the $(__final__) variable is defined and
5 kx ####### we don't try to download sources because they already downloaded.
5 kx ####### More over we don't need to have the '.src_requires' and
5 kx ####### '.src_requires_depend' files.
5 kx #######
5 kx ####### Such behavior is invented aspecialy to avoid competition in case
5 kx ####### when during parallel build different processes can run the same
5 kx ####### Makefile and all of them can start the sources preparation.
5 kx #######
5 kx
5 kx .sources: .src_requires
5 kx
5 kx .src_requires_depend: .src_requires ;
5 kx
5 kx .src_requires: .makefile
5 kx ifneq ($(shell pwd),$(TOP_BUILD_DIR_ABS))
5 kx ifeq ($(filter %_clean,$(MAKECMDGOALS)),)
5 kx ifeq ($(__final__),)
5 kx @echo ""
5 kx @echo -e "################################################################"
5 kx @echo -e "#######"
5 kx @echo -e "####### Start of building source requires for '$(subst $(TOP_BUILD_DIR_ABS)/,,$(CURDIR))':"
5 kx @echo -e "#######"
5 kx @$(BUILDSYSTEM)/build_src_requires $(TOP_BUILD_DIR_ABS)
5 kx @__final__= TREE_RULE=local_all $(MAKE) TOOLCHAIN=$(TOOLCHAIN_NOARCH) HARDWARE=$(HARDWARE_NOARCH) FLAVOUR= -f .src_requires
5 kx @echo -e "#######"
5 kx @echo -e "####### End of building source requires for '$(subst $(TOP_BUILD_DIR_ABS)/,,$(CURDIR))'."
5 kx @echo -e "#######"
5 kx @echo -e "################################################################"
5 kx @echo ""
5 kx @touch $@
5 kx @touch .src_requires_depend
5 kx endif
5 kx endif
5 kx endif
5 kx
5 kx
5 kx
5 kx .build_system: .src_requires
5 kx ifneq ($(shell pwd),$(TOP_BUILD_DIR_ABS))
5 kx ifeq ($(shell pwd | grep $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR))$(shell pwd | grep $(BUILDSYSTEM)/3pp/sources),)
5 kx ifeq ($(shell pwd | grep $(BUILDSYSTEM)),)
5 kx @echo -e "################################################################"
5 kx @echo -e "#######"
5 kx @echo -e "####### Start to Check the BUILDSYSTEM is ready:"
5 kx @echo -e "#######"
5 kx @( cd $(BUILDSYSTEM) ; __final__= $(MAKE) TOOLCHAIN=$(TOOLCHAIN_BUILD_MACHINE) HARDWARE=$(HARDWARE_BUILD) FLAVOUR= all )
5 kx @echo -e "#######"
5 kx @echo -e "####### End of checking the BUILDSYSTEM."
5 kx @echo -e "#######"
5 kx @echo -e "################################################################"
5 kx endif
5 kx endif
5 kx endif
5 kx
5 kx
5 kx
5 kx #######
5 kx ####### Clean the whole source tree
5 kx #######
5 kx
5 kx global_clean: .global_clean
5 kx
5 kx .global_clean:
5 kx @echo ""
5 kx @echo -e "#######"
5 kx @echo -e "####### Cleaning the whole sources tree excluding downloaded sources..."
5 kx @echo -e "#######"
5 kx @$(BUILDSYSTEM)/global_clean $(addprefix ., $(TOOLCHAIN_NAMES)) $(TOP_BUILD_DIR_ABS)
5 kx
5 kx
5 kx #######
5 kx ####### Clean all downloaded source tarballs
5 kx #######
5 kx
5 kx downloads_clean: .downloads_clean
5 kx
5 kx .downloads_clean:
5 kx @echo ""
5 kx @echo -e "#######"
5 kx @echo -e "####### Cleaning Up all downloaded sources..."
5 kx @echo -e "#######"
5 kx @$(BUILDSYSTEM)/downloads_clean $(addprefix ., $(TOOLCHAIN_NOARCH)) $(BUILDSYSTEM)/3pp/sources
5 kx ifneq ($(wildcard $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR)),)
5 kx @$(BUILDSYSTEM)/downloads_clean $(addprefix ., $(TOOLCHAIN_NOARCH)) $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR)
5 kx endif
5 kx
5 kx
5 kx help:
5 kx @echo ""
5 kx @echo -e "Build System $(SYSTEM_VERSION)"
5 kx @echo ""
5 kx @echo -e "You can build and install software using command line such as follow:"
5 kx @echo ""
5 kx @echo -e " $$ [TOOLCHAIN=toolchain] [HARDWARE=hardware] [FLAVOUR=flavour] make [goal]"
5 kx @echo ""
5 kx @echo -e "The following MAKE goals are available:"
5 kx @echo ""
5 kx @echo -e " all - perform make build and install software in the all"
5 kx @echo -e " required directories which defined by REQUIRES"
5 kx @echo -e " variable in the local Makefile;"
5 kx @echo -e " local_all - build and install software prepared onlu by local"
5 kx @echo -e " Makefile;"
5 kx @echo -e " dist_clean,"
5 kx @echo -e " local_dist_clean - remove distribution packages from target directory"
5 kx @echo -e " defined by PRODUCTS_DEST_DIR variable. Note that"
5 kx @echo -e " is depends from targets defined by COMPONENT_TARGETS"
5 kx @echo -e " variable or command line;"
5 kx @echo -e " rootfs_clean,"
5 kx @echo -e " local_rootfs_clean - uninstall packages installed into target 'root file"
5 kx @echo -e " system' directory which defined by ROOTFS_DEST_DIR"
5 kx @echo -e " variable;"
5 kx @echo -e " clean,"
5 kx @echo -e " local_clean - clean up all built targets by this Makefile;"
5 kx @echo ""
5 kx @echo -e " If the one from above goals has prefix 'local_' then this goal affects only"
5 kx @echo -e " current directory. Otherwise this goal will be performed for all required"
5 kx @echo -e " directories which defined by REQUIRES variable."
5 kx @echo ""
5 kx @echo -e " configure_targets - select hardwares, for which the software will be built."
5 kx @echo -e " This command edits the build-config.mk file;"
5 kx @echo ""
5 kx @echo -e " requires-tree - create HTML file to show the requires tree for current"
5 kx @echo -e " directory. Note that this goal depends on goal all;"
5 kx @echo -e " packages-list - create HW.pkglist file which contains the list of packages"
5 kx @echo -e " in install order. Note that this goal depends on goal all;"
5 kx @echo -e " devices_table - create Devices Table for rootfs image creation procedure;"
5 kx @echo -e " packages_repo - copy Packages Repository into rootfs before image creation;"
5 kx @echo -e " ext4fs_image - create Ext4 Root FS for target Boot Image;"
5 kx @echo -e " products_release - install files into products directory for release;"
5 kx @echo ""
5 kx @echo -e " global_clean - clean up whole sourses tree excluding downloaded"
5 kx @echo -e " source tarballs;"
5 kx @echo -e " downloads_clean - remove all sourse tarball from 'sourses' directory;"
5 kx @echo ""
5 kx @echo -e " ccache_stats - show the ccache statistic"
5 kx @echo -e " ccache_cleanup - delete old ccache files and recalculate size counters."
5 kx @echo ""
5 kx @echo -e "Local Makefile is prepared for following target HW platforms:"
5 kx @echo ""
5 kx @for platform in $(COMPONENT_TARGETS) ; do \
5 kx echo -e " $$platform"; \
5 kx done
5 kx @echo ""
5 kx @echo -e "Enjoy."
5 kx @echo ""
5 kx
5 kx ccache_stats:
5 kx ifeq ($(NO_CCACHE),)
5 kx @echo ""
5 kx @echo -e "CCACHE statistic:"
5 kx @echo ""
5 kx @CCACHE_DIR=$(CACHED_CC_OUTPUT) $(CCACHE) -s
5 kx @echo ""
5 kx @echo -e "To set max cache size make use the following command"
5 kx @echo ""
5 kx @echo -e " $$ CCACHE_DIR=$(CACHED_CC_OUTPUT) $(CCACHE)-M 64G"
5 kx @echo ""
5 kx @echo -e "see CCACHE(1) for more information."
5 kx @echo ""
5 kx else
5 kx @echo ""
5 kx @echo -e "CCACHE disabled by setting 'NO_CCACHE=$(NO_CCACHE)' variable for this Makefile."
5 kx @echo ""
5 kx endif
5 kx
5 kx ccache_cleanup:
5 kx ifeq ($(NO_CCACHE),)
5 kx @echo ""
5 kx @echo -e "CCACHE cleanup:"
5 kx @echo ""
5 kx @CCACHE_DIR=$(CACHED_CC_OUTPUT) $(CCACHE) --cleanup
5 kx @echo ""
5 kx @echo -e "CCACHE $(CACHED_CC_OUTPUT) is clean."
5 kx @echo ""
5 kx else
5 kx @echo ""
5 kx @echo -e "CCACHE disabled by setting 'NO_CCACHE=$(NO_CCACHE)' variable for this Makefile."
5 kx @echo ""
5 kx endif
5 kx
5 kx configure_targets: $(BUILDSYSTEM)/build-config.mk
5 kx @BUILDSYSTEM=$(BUILDSYSTEM) \
5 kx CONFIG=$(BUILDSYSTEM)/build-config.mk \
5 kx CONSTANTS=$(BUILDSYSTEM)/constants.mk \
5 kx $(BUILDSYSTEM)/configure-targets
5 kx
5 kx #
5 kx # Print value of Makefile variable:
5 kx # --------------------------------
5 kx # usage:
5 kx # make -f Makefile print-BASH_PKG_VERSION
5 kx # output:
5 kx # BASH_PKG_VERSION = 4.3
5 kx #
5 kx print-%:
5 kx @echo '$* = $($*)'
5 kx
5 kx #######
5 kx ####### End of Build preparations & HW Independed GOALs Section.
5 kx #######
5 kx ################################################################
5 kx
5 kx
5 kx ################################################################
5 kx #######
5 kx ####### Source archive and patch handling:
5 kx #######
5 kx
5 kx # Patch dependency:
5 kx PATCHES_DEP = $(foreach patch,$(PATCHES),\
5 kx $(shell $(BUILDSYSTEM)/apply_patches $(patch) -dep-))
5 kx
5 kx SRC_DIR_BASE = $(dir $(SRC_DIR))
5 kx
5 kx # Unpack SRC_ARCHIVE in SRC_DIR and backup old SRC_DIR:
5 kx UNPACK_SRC_ARCHIVE = \
5 kx @echo "Expanding $(SRC_ARCHIVE)"; \
5 kx if [ -d $(SRC_DIR) ]; then mv $(SRC_DIR) $$(mktemp -d $(SRC_DIR).bak.XXXXXX); fi; \
5 kx mkdir -p $(SRC_DIR_BASE); \
5 kx $(if $(findstring .rpm,$(SRC_ARCHIVE)), \
5 kx cd $(SRC_DIR_BASE) && rpm2cpio $(SRC_ARCHIVE) | cpio -id --quiet, \
5 kx $(if $(findstring .zip,$(SRC_ARCHIVE)), \
5 kx unzip -q -d $(SRC_DIR_BASE) $(SRC_ARCHIVE), \
5 kx tar $(if $(findstring .bz2,$(SRC_ARCHIVE)),-xjf, \
5 kx $(if $(findstring .xz,$(SRC_ARCHIVE)),-xJf, \
5 kx $(if $(findstring .txz,$(SRC_ARCHIVE)),-xJf,-xzf))) \
5 kx $(SRC_ARCHIVE) -C $(SRC_DIR_BASE))); \
5 kx chmod -R u+w $(SRC_DIR)
5 kx
5 kx # Apply patches in PATCHES on SRC_DIR_BASE:
5 kx APPLY_PATCHES = $(quiet)$(foreach patch,$(PATCHES),\
5 kx $(BUILDSYSTEM)/apply_patches $(patch) $(SRC_DIR_BASE) &&) true
5 kx
5 kx # Apply patches in PATCHES on BASE of directory defined as argument:
5 kx apply-patches = $(quiet)$(foreach patch,$(PATCHES),\
5 kx $(BUILDSYSTEM)/apply_patches $(patch) $(dir $1) &&) true
5 kx
5 kx # Apply patches in OPT_PATCHES on SRC_DIR_BASE:
5 kx APPLY_OPT_PATCHES = $(quiet)$(foreach patch,$(OPT_PATCHES),\
5 kx $(BUILDSYSTEM)/apply_patches $(patch) $(SRC_DIR_BASE) &&) true
5 kx
5 kx # Apply patches in OPT_PATCHES on BASE of directory defined as argument:
5 kx apply-opt-patches = $(quiet)$(foreach patch,$(OPT_PATCHES),\
5 kx $(BUILDSYSTEM)/apply_patches $(patch) $(dir $1) &&) true
5 kx
5 kx
5 kx ################################################################
5 kx # Functions:
5 kx # =========
5 kx #
5 kx # Install package content into the current development environment:
5 kx # ----------------------------------------------------------------
5 kx #
5 kx # NOTE:
5 kx # - When we pass ARGS through STDIN [using '--' as end of options] we splits ARGS
5 kx # by new-line '\n' symbol.
5 kx # - When we pass ARGS in the command line, we have to add | tr '\n' ' ' | filter
5 kx # to change new-line with space.
5 kx #
5 kx install-into-devenv = \
5 kx @( cd $1 ; \
5 kx find . \( -type d -empty -o -type f -o -type l \) -printf '%P\n' | sed -e 's, ,\\040,g' | \
5 kx DO_CREATE_DIST_FILES=1 CWD=$(CURDIR) \
5 kx $(BUILDSYSTEM)/install_targets \
5 kx --preserve-source-dir=true \
5 kx --destination=$(TARGET_DEST_DIR) \
5 kx --toolchain=$(TOOLCHAIN) \
5 kx --hardware=$(HARDWARE) \
5 kx --flavour=$(FLAVOUR) \
5 kx -- \
5 kx )
5 kx # usage:
5 kx # $(call install-into-devenv,$(PKGDIR))
5 kx # where PKGDIR - is a directory where package installed from sources.
5 kx # ----------------------------------------------------------------
5 kx #
5 kx # Pull and Push variables into Perl Storable Hash saved in the
5 kx # $(BUILDSYSTEM)/var/tmp directory. These functions also prints
5 kx # echo to stdout stream:
5 kx # ----------------------------------------------------------------
5 kx push-env = $(shell $(BUILDSYSTEM)/transmitting_hash \
5 kx --set --hardware=$(HARDWARE) --flavour=$(FLAVOUR) \
5 kx --pool-name=$(strip $1) --name=$(strip $2) --value=$(strip $3))
5 kx
5 kx pull-env = $(shell $(BUILDSYSTEM)/transmitting_hash \
5 kx --get --hardware=$(HARDWARE) --flavour=$(FLAVOUR) \
5 kx --pool-name=$(strip $1) --name=$(strip $2) --value=$(strip $3))
5 kx
5 kx push-env-vo = $(shell $(BUILDSYSTEM)/transmitting_hash \
5 kx --set --value-only --hardware=$(HARDWARE) --flavour=$(FLAVOUR) \
5 kx --pool-name=$(strip $1) --name=$(strip $2) --value=$(strip $3))
5 kx
5 kx pull-env-vo = $(shell $(BUILDSYSTEM)/transmitting_hash \
5 kx --get --value-only --hardware=$(HARDWARE) --flavour=$(FLAVOUR) \
5 kx --pool-name=$(strip $1) --name=$(strip $2) --value=$(strip $3))
5 kx #
5 kx # usage:
5 kx # -----
5 kx # environment = $(call push-env, perl, HOME, \'/home/kx\')
5 kx # environment += $(call push-env, perl, DIR, \'$(CURDIR)\')
5 kx # environment += $(call push-env, perl, BASH, \'/bin/bash\')
5 kx # environment += --set $(call push-env, perl, archlib, \'/usr/lib$(LIBSUFFIX)/perl5/$(ARCHNAME)\')
5 kx #
5 kx # environment = HOME=$(call pull-env-vo, perl, HOME, \'/home/olga\')
5 kx # environment += DIR=$(call pull-env-vo, perl, DIR, \'$(CURDIR)\')
5 kx # environment += BASH=$(call pull-env-vo, perl, BASH, \'/bin/sh\')
5 kx # environment += --set archlib=$(call pull-env-vo, perl, archlib, \'/usr/lib$(LIBSUFFIX)/perl5/$(ARCHNAME)\')
5 kx # ----------------------------------------------------------------
5 kx #
5 kx # End of Functions.
5 kx ################################################################
5 kx
5 kx
5 kx
5 kx ################################################################
5 kx #
5 kx # Example rule:
5 kx #
5 kx # src_done = $(SRC_DIR)/.source-done
5 kx #
5 kx # $(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
5 kx # $(UNPACK_SRC_ARCHIVE)
5 kx # $(APPLY_PATCHES)
5 kx # <other stuff that needs to be done to the source,
5 kx # should be empty in most cases>
5 kx # @touch $@
5 kx #
5 kx ################################################################
5 kx
5 kx #######
5 kx ####### Source archive and patch handling.
5 kx #######
5 kx ################################################################
5 kx
5 kx
5 kx ################################################################
5 kx #######
5 kx ####### Include files with references to BUILD-SYSTEM scripts:
5 kx #######
5 kx
5 kx -include $(BUILDSYSTEM)/progs/.config
5 kx -include $(BUILDSYSTEM)/sbin/.config
5 kx
5 kx #######
5 kx ####### References to BUILD-SYSTEM scripts.
5 kx #######
5 kx ################################################################
5 kx
5 kx
5 kx
5 kx ################################################################
5 kx #
5 kx # No '__final__' target selected:
5 kx # ==============================
5 kx #
5 kx # Parse TOOLCHAIN, HARDWARE, FLAVOUR selected in command line
5 kx # and build the list of '__final__' targets.
5 kx #
5 kx ifeq ($(__final__),)
5 kx
5 kx #
5 kx # The FLAVOUR can be defined in command line.
5 kx # If command line defines empty flavour FLAVOUR= then
5 kx # we define that variable is set but has no values.
5 kx #
5 kx __cmdline_flavour_defined = $(if $(filter FLAVOUR,$(.VARIABLES)),true,false)
5 kx ifeq ($(__cmdline_flavour_defined),true)
5 kx __cmdline_flavour_value = $(FLAVOUR)
5 kx else
5 kx __cmdline_flavour_value =
5 kx endif
5 kx
5 kx ##############################################################
5 kx # -----------+----------+---------+-------------------+-----
5 kx # TOOLCHAIN | HARDWARE | FLAVOUR | FLAVOUR has VALUE | REF
5 kx # -----------+----------+---------+-------------------+-----
5 kx # defined | defined | defined | yes | (0)
5 kx # defined | defined | defined | no | (1)
5 kx # defined | defined | ~ | ~ | (2)
5 kx # -----------+----------+---------+-------------------+-----
5 kx # defined | ~ | defined | yes | (3)
5 kx # defined | ~ | defined | no | (4)
5 kx # defined | ~ | ~ | ~ | (5)
5 kx # -----------+----------+---------+-------------------+-----
5 kx # ~ | defined | defined | yes | (6)
5 kx # ~ | defined | defined | no | (7)
5 kx # ~ | defined | ~ | ~ | (8)
5 kx # -----------+----------+---------+-------------------+-----
5 kx # ~ | ~ | defined | yes | (9)
5 kx # ~ | ~ | defined | no | (A)
5 kx # ~ | ~ | ~ | ~ | (B)
5 kx # -----------+----------+---------+-------------------+-----
5 kx ##############################################################
5 kx
5 kx # we allow only available combinations according to component targets and flavours lists
5 kx
5 kx ifeq ($(TOOLCHAIN),)
5 kx ifeq ($(HARDWARE),)
5 kx ifeq ($(FLAVOUR),)
5 kx ifeq ($(__cmdline_flavour_defined),false)
5 kx # (B) ======= loop: T, H, F; =======
5 kx __target_args = $(__available_targets)
5 kx else
5 kx # (A) ======= loop: T, H ; where F=0 =======
5 kx __target_args = $(foreach arch, $(shell echo $(COMPONENT_TOOLCHAINS) | sed -e 's/x86_64/x86-64/g'), \
5 kx $(foreach hardware, $($(shell echo ${arch} | tr '[a-z-]' '[A-Z_]')_HARDWARE_VARIANTS), \
5 kx .target_$(arch)_$(hardware) \
5 kx ) \
5 kx )
5 kx endif
5 kx else
5 kx # (9) ======= loop: T, H ; where F=const =======
5 kx __target_args = $(foreach arch, $(shell echo $(COMPONENT_TOOLCHAINS) | sed -e 's/x86_64/x86-64/g'), \
5 kx $(foreach hardware, $($(shell echo ${arch} | tr '[a-z-]' '[A-Z_]')_HARDWARE_VARIANTS), \
5 kx $(if $(filter $(FLAVOUR), $($(shell echo ${hardware} | tr '[a-z]' '[A-Z]')_FLAVOURS)), \
5 kx .target_$(arch)_$(hardware)_$(FLAVOUR), \
5 kx $(if $(filter $(FLAVOUR), $(FLAVOURS)), \
5 kx .target_$(arch)_$(hardware)_$(FLAVOUR), \
5 kx ) \
5 kx ) \
5 kx ) \
5 kx )
5 kx endif
5 kx else
5 kx ifeq ($(FLAVOUR),)
5 kx ifeq ($(__cmdline_flavour_defined),false)
5 kx # (8) ======= loop: T, , F; where H=const =======
5 kx __target_args = $(foreach arch, $(shell echo $(call toolchain,$(HARDWARE)) | sed -e 's/x86_64/x86-64/g'), \
5 kx $(if $($(shell echo $(HARDWARE) | tr '[a-z]' '[A-Z]')_FLAVOURS), \
5 kx $(foreach flavour, $($(shell echo $(HARDWARE) | tr '[a-z]' '[A-Z]')_FLAVOURS), \
5 kx .target_$(arch)_$(HARDWARE)_$(flavour) \
5 kx ) .target_$(arch)_$(HARDWARE), \
5 kx $(if $(FLAVOURS), \
5 kx $(foreach flavour, $(FLAVOURS), \
5 kx .target_$(arch)_$(HARDWARE)_$(flavour) \
5 kx ), \
5 kx ) .target_$(arch)_$(HARDWARE) \
5 kx ) \
5 kx )
5 kx else
5 kx # (7) ======= loop: T, , ; where H=const, F=0 =======
5 kx __target_args = $(foreach arch, $(shell echo $(call toolchain,$(HARDWARE)) | sed -e 's/x86_64/x86-64/g'), \
5 kx .target_$(arch)_$(HARDWARE) \
5 kx )
5 kx endif
5 kx else
5 kx # (6) ======= loop: T, , ; where H=const, F=const =======
5 kx __target_args = $(foreach arch, $(shell echo $(call toolchain,$(HARDWARE)) | sed -e 's/x86_64/x86-64/g'), \
5 kx .target_$(arch)_$(HARDWARE)_$(FLAVOUR) \
5 kx )
5 kx endif
5 kx endif
5 kx else
5 kx ifeq ($(HARDWARE),)
5 kx ifeq ($(FLAVOUR),)
5 kx ifeq ($(__cmdline_flavour_defined),false)
5 kx # (5) ======= loop: , H, F; where T=const =======
5 kx __target_args = $(foreach hardware, $($(shell echo $(TOOLCHAIN) | tr '[a-z-]' '[A-Z_]')_HARDWARE_VARIANTS), \
5 kx $(if $($(shell echo ${hardware} | tr '[a-z]' '[A-Z]')_FLAVOURS), \
5 kx $(foreach flavour, $($(shell echo ${hardware} | tr '[a-z]' '[A-Z]')_FLAVOURS), \
5 kx .target_$(shell echo $(TOOLCHAIN) | sed -e 's/x86_64/x86-64/g')_$(hardware)_$(flavour) \
5 kx ) .target_$(shell echo $(TOOLCHAIN) | sed -e 's/x86_64/x86-64/g')_$(hardware), \
5 kx $(if $(FLAVOURS), \
5 kx $(foreach flavour, $(FLAVOURS), \
5 kx .target_$(shell echo $(TOOLCHAIN) | sed -e 's/x86_64/x86-64/g')_$(hardware)_$(flavour) \
5 kx ), \
5 kx ) \
5 kx .target_$(shell echo $(TOOLCHAIN) | sed -e 's/x86_64/x86-64/g')_$(hardware) \
5 kx ) \
5 kx )
5 kx else
5 kx # (4) ======= loop: , H, ; where T=const, F=0 =======
5 kx __target_args = $(foreach hardware, $($(shell echo $(TOOLCHAIN) | tr '[a-z-]' '[A-Z_]')_HARDWARE_VARIANTS), \
5 kx .target_$(shell echo $(TOOLCHAIN) | sed -e 's/x86_64/x86-64/g')_$(hardware) \
5 kx )
5 kx endif
5 kx else
5 kx # (3) ======= loop: , H, ; where T=const, F=const =======
5 kx __target_args = $(foreach hardware, $($(shell echo $(TOOLCHAIN) | tr '[a-z-]' '[A-Z_]')_HARDWARE_VARIANTS), \
5 kx .target_$(shell echo $(TOOLCHAIN) | sed -e 's/x86_64/x86-64/g')_$(hardware)_$(FLAVOUR) \
5 kx )
5 kx endif
5 kx else
5 kx ifeq ($(FLAVOUR),)
5 kx ifeq ($(__cmdline_flavour_defined),false)
5 kx # (2) ======= loop: , , F; where T=const, H=const =======
5 kx __target_args = $(if $($(shell echo $(HARDWARE) | tr '[a-z]' '[A-Z]')_FLAVOURS), \
5 kx $(foreach flavour, $($(shell echo $(HARDWARE) | tr '[a-z]' '[A-Z]')_FLAVOURS), \
5 kx .target_$(shell echo $(TOOLCHAIN) | sed -e 's/x86_64/x86-64/g')_$(HARDWARE)_$(flavour) \
5 kx ) .target_$(shell echo $(TOOLCHAIN) | sed -e 's/x86_64/x86-64/g')_$(HARDWARE), \
5 kx $(if $(FLAVOURS), \
5 kx $(foreach flavour, $(FLAVOURS), \
5 kx .target_$(shell echo $(TOOLCHAIN) | sed -e 's/x86_64/x86-64/g')_$(HARDWARE)_$(flavour) \
5 kx ) .target_$(shell echo $(TOOLCHAIN) | sed -e 's/x86_64/x86-64/g')_$(HARDWARE), \
5 kx ) .target_$(shell echo $(TOOLCHAIN) | sed -e 's/x86_64/x86-64/g')_$(HARDWARE) \
5 kx )
5 kx else
5 kx # (1) ======= loop: , , ; T=const, H=const, F=0 =======
5 kx __target_args = .target_$(shell echo $(TOOLCHAIN) | sed -e 's/x86_64/x86-64/g')_$(HARDWARE)
5 kx endif
5 kx else
5 kx # (0) ======= loop: , , ; T=const, H=const, F=const =======
5 kx __target_args = .target_$(shell echo $(TOOLCHAIN) | sed -e 's/x86_64/x86-64/g')_$(HARDWARE)_$(FLAVOUR)
5 kx endif
5 kx endif
5 kx endif
5 kx
5 kx __target_args := $(strip $(__target_args))
5 kx
5 kx
5 kx __targets = $(filter $(__target_args), $(__available_targets))
5 kx
5 kx # Now we have to sort targets for that the main targets should be built before flavours!
5 kx __targets := $(sort $(__targets))
5 kx
5 kx
5 kx ifeq ($(__targets),)
5 kx $(error Error: Selected combination [TOOLCHAIN=$(TOOLCHAIN), HARDWARE=$(HARDWARE), FLAVOUR=$(FLAVOUR)] is invalid for this Makefile)
5 kx endif
5 kx
5 kx $(__targets): .setup
5 kx
5 kx
5 kx #
5 kx # NOTE:
5 kx # ====
5 kx # Several FLAVOURS can require the same package, for example, base/pkgtool.
5 kx # To avoid concurrency problems we have to diable parallel building for Makefiles
5 kx # where there are FLAVOURS.
5 kx #
5 kx # We have to check both HW specific and general FLAVOURS.
5 kx #
5 kx all-flavour-values = $(strip $(foreach flname, $(filter FLAVOURS %_FLAVOURS, $(.VARIABLES)), $($(flname))))
5 kx
5 kx ifneq ($(all-flavour-values),)
5 kx .NOTPARALLEL: $(__targets)
5 kx endif
5 kx
5 kx
5 kx local_all: GOAL = local_all
5 kx local_all: $(__targets)
5 kx
5 kx
5 kx local_clean: GOAL = local_clean
5 kx local_clean: $(__targets)
5 kx
5 kx
5 kx local_dist_clean: GOAL = local_dist_clean
5 kx local_dist_clean: $(__targets)
5 kx
5 kx
5 kx local_rootfs_clean: GOAL = local_rootfs_clean
5 kx local_rootfs_clean: $(__targets)
5 kx
5 kx requires-tree: GOAL = requires-tree
5 kx requires-tree: $(__targets)
5 kx
5 kx packages-list: GOAL = packages-list
5 kx packages-list: $(__targets)
5 kx
5 kx devices_table: GOAL = devices_table
5 kx devices_table: $(__targets)
5 kx
5 kx packages_repo: GOAL = packages_repo
5 kx packages_repo: $(__targets)
5 kx
5 kx ext4fs_image: GOAL = ext4fs_image
5 kx ext4fs_image: $(__targets)
5 kx
5 kx products_release: GOAL = products_release
5 kx products_release: $(__targets)
5 kx
5 kx
5 kx .target_%: TOOLCHAIN = $(shell echo $(word 2, $(subst _, , $@)) | sed -e 's/x86-64/x86_64/g')
5 kx .target_%: HARDWARE = $(if $(filter $(shell echo $(word 3, $(subst _, , $@))),$(HARDWARE_ALL)),$(word 3, $(subst _, , $@)))
5 kx .target_%: FLAVOUR = $(if $(word 4, $(subst _, , $@)),$(word 4, $(subst _, , $@)),$(if $(filter $(shell echo $(word 3, $(subst _, , $@))),$(HARDWARE_ALL)),,$(word 3, $(subst _, , $@))))
5 kx .target_%:
5 kx @echo ""
5 kx @echo -e "################################################################"
5 kx @echo -e "#######"
5 kx @echo -e "####### TOOLCHAIN=$(TOOLCHAIN) ; HARDWARE=$(HARDWARE) ; FLAVOUR=$(if $(FLAVOUR),$(FLAVOUR)) ;"
5 kx @echo -e "#######"
5 kx @__final__=true $(MAKE) TOOLCHAIN=$(TOOLCHAIN) HARDWARE=$(HARDWARE) FLAVOUR=$(FLAVOUR) $(GOAL)
5 kx
5 kx
5 kx else
5 kx #
5 kx ################################################################
5 kx #
5 kx # The '__final__' target is defined, run the build process.
5 kx
5 kx
5 kx targetflavour = .$(TOOLCHAIN)/$(HARDWARE)$(if $(FLAVOUR),/$(FLAVOUR),)
5 kx
5 kx TARGET_BUILD_DIR = $(targetflavour)
5 kx
5 kx ifeq ($(filter %_clean,$(MAKECMDGOALS)),)
5 kx ifneq ($(shell pwd),$(TOP_BUILD_DIR_ABS))
5 kx ifeq ($(shell pwd | grep $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR))$(shell pwd | grep $(BUILDSYSTEM)/3pp/sources),)
5 kx $(shell mkdir -p .$(TOOLCHAIN)/$(HARDWARE)$(if $(FLAVOUR),/$(FLAVOUR)))
5 kx endif
5 kx endif
5 kx endif
5 kx
5 kx ifneq ($(NO_CREATE_DIST_FILES),true)
5 kx local_all: CREATE_DIST_FILES = 1
5 kx endif
5 kx
5 kx
5 kx ifeq ($(BUILD_TREE),true)
5 kx _tree := .tree_all
5 kx else
5 kx _tree := .requires_makefile
5 kx endif
5 kx
5 kx #
5 kx local_all: .toolchain $(_tree) _install
5 kx
5 kx
5 kx ifeq ($(CLEAN_TREE),true)
5 kx local_clean: .tree_clean
5 kx else
5 kx local_clean:
5 kx endif
5 kx
5 kx ifeq ($(DIST_CLEAN_TREE),true)
5 kx local_dist_clean: .tree_dist_clean
5 kx else
5 kx local_dist_clean:
5 kx endif
5 kx
5 kx ifeq ($(ROOTFS_CLEAN_TREE),true)
5 kx local_rootfs_clean: .tree_rootfs_clean
5 kx else
5 kx local_rootfs_clean:
5 kx endif
5 kx
5 kx .toolchain:
5 kx ifneq ($(TOOLCHAIN_PATH),)
5 kx ifeq ($(wildcard $(TOOLCHAIN_PATH)),)
5 kx @echo -e "################################################################"
5 kx @echo -e "#######"
5 kx @echo -e "####### Start of downloading toolchain '$(shell basename $(TOOLCHAIN_TARBALL))':"
5 kx @echo -e "#######"
5 kx @if [ -d $(TOOLCHAINS_BASE_PATH) -a -w $(TOOLCHAINS_BASE_PATH) ] ; then \
5 kx ( cd $(TOOLCHAINS_BASE_PATH) ; \
5 kx $(BUILDSYSTEM)/download-toolchain "$(DOWNLOAD_SERVER)/$(TOOLCHAIN_TARBALL)" ; \
5 kx ) ; \
5 kx else \
5 kx echo -e "#" ; \
5 kx echo -e "#" ; \
5 kx echo -e "# Please create '$(TOOLCHAINS_BASE_PATH)' directory" ; \
5 kx echo -e "# and give write permissions to '$(shell echo "`id -u -n`")':" ; \
5 kx echo -e "#" ; \
5 kx echo -e "# # sudo mkdir -p $(TOOLCHAINS_BASE_PATH)" ; \
5 kx echo -e "# # sudo chown -R $(shell echo "`id -u -n`"):$(shell echo "`id -g -n`") $(TOOLCHAINS_BASE_PATH)" ; \
5 kx echo -e "#" ; \
5 kx echo -e "#" ; \
5 kx echo -e "# ERROR: $(TOOLCHAINS_BASE_PATH): Permission denied. Stop." ; \
5 kx echo -e "#" ; \
5 kx exit 1 ; \
5 kx fi
5 kx @echo -e "#######"
5 kx @echo -e "####### End of downloading toolchain '$(shell basename $(TOOLCHAIN_TARBALL))'."
5 kx @echo -e "#######"
5 kx @echo -e "################################################################"
5 kx endif
5 kx endif
5 kx
5 kx
5 kx .tree_all: BUILD_TREE := false
5 kx
5 kx .tree_all: $(TARGET_BUILD_DIR)/.requires
5 kx ifneq ($(shell pwd),$(TOP_BUILD_DIR_ABS))
5 kx ifeq ($(shell pwd | grep $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR))$(shell pwd | grep $(BUILDSYSTEM)/3pp/sources),)
5 kx @echo -e "################################################################"
5 kx @echo -e "#######"
5 kx ifeq ($(shell pwd),$(BUILDSYSTEM))
5 kx @echo -e "####### Start of building requires for '$(subst $(TOP_BUILD_DIR_ABS)/,,$(CURDIR))':"
5 kx else
5 kx @echo -e "####### Start of building requires for TOOLCHAIN=$(TOOLCHAIN) HARDWARE=$(HARDWARE) FLAVOUR=$(FLAVOUR) in '$(subst $(TOP_BUILD_DIR_ABS)/,,$(CURDIR))':"
5 kx endif
5 kx @echo -e "#######"
5 kx ifeq ($(shell pwd),$(BUILDSYSTEM))
5 kx @__final__=true TREE_RULE=local_all $(MAKE) TOOLCHAIN=$(TOOLCHAIN_BUILD_MACHINE) HARDWARE=$(HARDWARE_BUILD) FLAVOUR= -f $(TARGET_BUILD_DIR)/.requires
5 kx else
5 kx @__final__=true TREE_RULE=local_all $(MAKE) TOOLCHAIN=$(TOOLCHAIN) HARDWARE=$(HARDWARE) FLAVOUR= -f $(TARGET_BUILD_DIR)/.requires
5 kx endif
5 kx @echo -e "#######"
5 kx @echo -e "####### End of building requires for '$(subst $(TOP_BUILD_DIR_ABS)/,,$(CURDIR))'."
5 kx @echo -e "#######"
5 kx @echo -e "################################################################"
5 kx endif
5 kx endif
5 kx
5 kx
5 kx # We always build requires Makeile '.requires_makefile' (for both local and tree build processes).
5 kx # This is needed to cover all tree. In other words we want to have '$(TARGET_BUILD_DIR)/.requires'
5 kx # file in the each directory to be able run 'make requires-tree' command.
5 kx #
5 kx
5 kx .requires_makefile: $(TARGET_BUILD_DIR)/.requires
5 kx
5 kx
5 kx #######
5 kx ####### Build directory dependencies into $(TARGET_BUILD_DIR)/.requires
5 kx ####### file which is used as a Makefile for tree builds.
5 kx #######
5 kx
5 kx $(TARGET_BUILD_DIR)/.requires_depend: $(TARGET_BUILD_DIR)/.requires ;
5 kx
5 kx $(TARGET_BUILD_DIR)/.requires: .makefile
5 kx ifeq ($(filter %_clean,$(MAKECMDGOALS)),)
5 kx ifneq ($(shell pwd),$(TOP_BUILD_DIR_ABS))
5 kx ifeq ($(shell pwd | grep $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR))$(shell pwd | grep $(BUILDSYSTEM)/3pp/sources),)
5 kx ifeq ($(shell pwd),$(BUILDSYSTEM))
5 kx @$(BUILDSYSTEM)/build_requires $(TOP_BUILD_DIR_ABS) $(TOOLCHAIN_BUILD_MACHINE) $(HARDWARE_BUILD) ; wait
5 kx else
5 kx @$(BUILDSYSTEM)/build_requires $(TOP_BUILD_DIR_ABS) $(TOOLCHAIN) $(HARDWARE) $(FLAVOUR) ; wait
5 kx endif
5 kx endif
5 kx endif
5 kx endif
5 kx
5 kx
5 kx
5 kx
5 kx ################################################################
5 kx #######
5 kx ####### Tree Clean up rules:
5 kx #######
5 kx
5 kx .tree_clean: CLEAN_TREE := false
5 kx
5 kx .tree_clean: $(TARGET_BUILD_DIR)/.requires
5 kx ifneq ($(shell pwd),$(TOP_BUILD_DIR_ABS))
5 kx ifeq ($(shell pwd | grep $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR))$(shell pwd | grep $(BUILDSYSTEM)/3pp/sources),)
5 kx ifneq ($(wildcard $(TARGET_BUILD_DIR)/.requires),)
5 kx ifeq ($(shell pwd),$(BUILDSYSTEM))
5 kx @__final__=true TREE_RULE=local_clean $(MAKE) TOOLCHAIN=$(TOOLCHAIN_BUILD_MACHINE) HARDWARE=$(HARDWARE_BUILD) FLAVOUR= -f $(TARGET_BUILD_DIR)/.requires
5 kx else
5 kx @__final__=true TREE_RULE=local_clean $(MAKE) TOOLCHAIN=$(TOOLCHAIN) HARDWARE=$(HARDWARE) FLAVOUR= -f $(TARGET_BUILD_DIR)/.requires
5 kx endif
5 kx endif
5 kx endif
5 kx endif
5 kx
5 kx
5 kx .tree_dist_clean: DIST_CLEAN_TREE := false
5 kx
5 kx .tree_dist_clean: $(TARGET_BUILD_DIR)/.requires
5 kx ifneq ($(shell pwd),$(TOP_BUILD_DIR_ABS))
5 kx ifeq ($(shell pwd | grep $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR))$(shell pwd | grep $(BUILDSYSTEM)/3pp/sources),)
5 kx ifneq ($(shell pwd),$(BUILDSYSTEM))
5 kx @__final__=true TREE_RULE=local_dist_clean $(MAKE) TOOLCHAIN=$(TOOLCHAIN) HARDWARE=$(HARDWARE) FLAVOUR= -f $(TARGET_BUILD_DIR)/.requires
5 kx endif
5 kx endif
5 kx endif
5 kx
5 kx
5 kx .tree_rootfs_clean: ROOTFS_CLEAN_TREE := false
5 kx
5 kx .tree_rootfs_clean: $(TARGET_BUILD_DIR)/.requires
5 kx ifneq ($(shell pwd),$(TOP_BUILD_DIR_ABS))
5 kx ifeq ($(shell pwd | grep $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR))$(shell pwd | grep $(BUILDSYSTEM)/3pp/sources),)
5 kx ifneq ($(shell pwd),$(BUILDSYSTEM))
5 kx @__final__=true TREE_RULE=local_rootfs_clean $(MAKE) TOOLCHAIN=$(TOOLCHAIN) HARDWARE=$(HARDWARE) FLAVOUR= -f $(TARGET_BUILD_DIR)/.requires
5 kx endif
5 kx endif
5 kx endif
5 kx
5 kx
5 kx #######
5 kx ####### End of Tree Clean up rules.
5 kx #######
5 kx ################################################################
5 kx
5 kx
5 kx
5 kx ################################################################
5 kx #######
5 kx ####### Clean up default rules:
5 kx #######
5 kx
5 kx
5 kx #######
5 kx ####### Clean:
5 kx #######
5 kx
5 kx #
5 kx # CLEANUP_FILES can be placed outside $(TARGET_BUILD_DIR) directory,
5 kx # the '.$(TOOLCHAIN)' directory can be removed if it is empty ONLY.
5 kx #
5 kx
5 kx local_clean: .local_clean
5 kx ifeq ($(shell pwd | grep $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR))$(shell pwd | grep $(BUILDSYSTEM)/3pp/sources),)
5 kx ifneq ($(wildcard .$(TOOLCHAIN)),)
5 kx @rm -rf $(CLEANUP_FILES)
5 kx ifneq ($(wildcard $(TARGET_BUILD_DIR)),)
5 kx @rm -rf $(TARGET_BUILD_DIR)
5 kx endif
5 kx @if [ "`find .$(TOOLCHAIN) -maxdepth 0 -empty`" ] ; then rm -rf .$(TOOLCHAIN) ; fi
5 kx endif
5 kx endif
5 kx
5 kx .local_clean:
5 kx ifneq ($(shell pwd | grep $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR))$(shell pwd | grep $(BUILDSYSTEM)/3pp/sources),)
5 kx @echo -e "####### Cleaning in '`basename $(CURDIR)`' directory is not supported."
5 kx else
5 kx @echo -e "####### Local Cleaning in '`basename $(CURDIR)`' directory..."
5 kx endif
5 kx
5 kx
5 kx #######
5 kx ####### Destination Clean:
5 kx #######
5 kx
5 kx #
5 kx # dist & rootfs cleaning perform only if *.dist, *.rootfs file exists
5 kx # For the product packages, BIN & SCRIPT ..._TARGETS we create *.dist
5 kx # files for each hardware:
5 kx #
5 kx # .$(HARDWARE).dist
5 kx #
5 kx # Rootfs target have to be alone because we install into root fs only
5 kx # main package (flavour package we copy only into dist/products/...)
5 kx #
5 kx # .$(HARDWARE).rootfs
5 kx #
5 kx
5 kx local_dist_clean: .local_dist_clean
5 kx ifneq ($(shell pwd),$(BUILDSYSTEM))
5 kx ifeq ($(shell pwd | grep $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR))$(shell pwd | grep $(BUILDSYSTEM)/3pp/sources),)
5 kx ifeq ($(wildcard $(TARGET_BUILD_DIR)/.dist),)
5 kx @echo -e " (nothing to be done)."
5 kx else
5 kx @if [ -f $(TARGET_BUILD_DIR)/.dist ] ; then \
5 kx $(BUILDSYSTEM)/dist_clean --destination=$(DEST_DIR) \
5 kx --toolchain=$(TOOLCHAIN) --hardware=$(HARDWARE) --flavour=$(FLAVOUR) ; \
5 kx rm -f $(TARGET_BUILD_DIR)/.dist ; \
5 kx fi
5 kx @rm -rf $(TARGET_BUILD_DIR)/.dist*
5 kx @echo -e " (done)."
5 kx endif
5 kx endif
5 kx endif
5 kx
5 kx .local_dist_clean:
5 kx ifeq ($(shell pwd),$(BUILDSYSTEM))
5 kx @echo -e "####### Destination cleaning in '`basename $(CURDIR)`' directory is not supported."
5 kx else
5 kx ifneq ($(shell pwd | grep $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR))$(shell pwd | grep $(BUILDSYSTEM)/3pp/sources),)
5 kx @echo -e "####### Destination cleaning in '`basename $(CURDIR)`' directory is not supported."
5 kx else
5 kx @echo -n -e "####### Destination cleaning in '`basename $(CURDIR)`' directory..."
5 kx endif
5 kx endif
5 kx
5 kx
5 kx #######
5 kx ####### Root File System Clean:
5 kx #######
5 kx
5 kx local_rootfs_clean: .local_rootfs_clean
5 kx ifneq ($(shell pwd),$(BUILDSYSTEM))
5 kx ifeq ($(shell pwd | grep $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR))$(shell pwd | grep $(BUILDSYSTEM)/3pp/sources),)
5 kx ifeq ($(wildcard $(TARGET_BUILD_DIR)/.rootfs),)
5 kx @echo -e "####### Root File System cleaning... (nothing to be done)."
5 kx else
5 kx @if [ -f $(TARGET_BUILD_DIR)/.rootfs ]; then \
5 kx REMOVE_PACKAGE="$(REMOVE_PACKAGE)" $(BUILDSYSTEM)/rootfs_clean \
5 kx --destination=$(DEST_DIR) \
5 kx --toolchain=$(TOOLCHAIN) \
5 kx --hardware=$(HARDWARE) \
5 kx --flavour=$(FLAVOUR) ; \
5 kx else \
5 kx echo -e "B####### ... Nothing to be done (there are no installed packages)." ; \
5 kx fi
5 kx @rm -rf $(TARGET_BUILD_DIR)/.rootfs
5 kx endif
5 kx endif
5 kx endif
5 kx
5 kx .local_rootfs_clean:
5 kx ifeq ($(shell pwd),$(BUILDSYSTEM))
5 kx @echo -e "####### Root file system cleaning in '`basename $(CURDIR)`' directory is not supported."
5 kx else
5 kx ifneq ($(shell pwd | grep $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR))$(shell pwd | grep $(BUILDSYSTEM)/3pp/sources),)
5 kx @echo -e "####### Root file system cleaning in '`basename $(CURDIR)`' directory is not supported."
5 kx else
5 kx @echo -e "#######"
5 kx @echo -e "####### Remove packages from 'dist/rootfs/$(TOOLCHAIN)/$(HARDWARE)/...' file system..."
5 kx @echo -e "#######"
5 kx endif
5 kx endif
5 kx
5 kx
5 kx #######
5 kx ####### End of Clean up default rules.
5 kx #######
5 kx ################################################################
5 kx
5 kx
5 kx ################################################################
5 kx #######
5 kx ####### Build REQUIRES tree:
5 kx #######
5 kx
5 kx #
5 kx # Create $(HARDWARE).tree.html if current Makefile defines packages collection
5 kx # or $(GROUP)/$(PKG_NAME)-$(PKG_VERSION).tree.html if current Makefile defines
5 kx # single package:
5 kx #
5 kx requires-tree: $(TARGET_BUILD_DIR)/.$(HARDWARE).srctree
5 kx
5 kx #
5 kx # Requires Tree perform only if goal 'all' is done and all packages installed
5 kx # into root filesystem or into products directory.
5 kx #
5 kx # NOTE:
5 kx # GNU Make `wildcard' function doesn't work with files which created
5 kx # during Makefile works. For normal work all tested files should be
5 kx # created before the Makefile starting my make command.
5 kx #
5 kx $(TARGET_BUILD_DIR)/.$(HARDWARE).srctree:
5 kx ifneq ($(shell pwd),$(BUILDSYSTEM))
5 kx ifeq ($(shell pwd | grep $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR))$(shell pwd | grep $(BUILDSYSTEM)/3pp/sources),)
5 kx ifeq ($(shell pwd),$(TOP_BUILD_DIR_ABS))
5 kx @echo -e "#######"
5 kx @echo -e "####### Requires Tree creation in the top of '`basename $(CURDIR)`' directory is not supported."
5 kx @echo -e "#######"
5 kx else
5 kx ifeq ($(wildcard $(TARGET_BUILD_DIR)/.requires),)
5 kx @echo -e " (nothing to be done)."
5 kx @echo -e "#######"
5 kx @echo -e "####### Before creating a dependency tree all goals have to be made."
5 kx @echo -e "#######"
5 kx else
5 kx @echo -e "################################################################"
5 kx @echo -e "#######"
5 kx @echo -e "####### Start of building Requires Tree in '`echo $(CURDIR) | sed 's,$(TOP_BUILD_DIR_ABS)/,,'`' directory..."
5 kx @echo -e "#######"
5 kx @$(BUILDSYSTEM)/build-pkglist tree $(TOP_BUILD_DIR_ABS) $(TOOLCHAIN) $(HARDWARE) $(FLAVOUR)
5 kx @echo -e "#######"
5 kx @echo -e "####### End of building Requires Tree in '`echo $(CURDIR) | sed 's,$(TOP_BUILD_DIR_ABS)/,,'`' directory."
5 kx @echo -e "#######"
5 kx @echo -e "################################################################"
5 kx endif
5 kx endif
5 kx endif
5 kx endif
5 kx
5 kx #######
5 kx ####### End of Build REQUIRES tree.
5 kx #######
5 kx ################################################################
5 kx
5 kx
5 kx ################################################################
5 kx #######
5 kx ####### Build PACKAGES list:
5 kx #######
5 kx
5 kx #
5 kx # Create $(HARDWARE).pkglist if current Makefile defines packages collection
5 kx # or $(GROUP)/$(PKG_NAME)-$(PKG_VERSION).pkglist if current Makefile defines
5 kx # single package.
5 kx #
5 kx
5 kx #
5 kx # Both .$(HARDWARE).srclist and $(HARDWARE).pkglist files
5 kx # created by `make packages-list' procedure. But the $(HARDWARE).pkglist
5 kx # is a main target of `make packages-list' procedure:
5 kx #
5 kx packages-list: $(TARGET_BUILD_DIR)/$(HARDWARE).pkglist
5 kx
5 kx #
5 kx # Packages List perform only if goal 'all' is done and all packages installed
5 kx # into root filesystem or into products directory.
5 kx #
5 kx # NOTE:
5 kx # GNU Make `wildcard' function doesn't work with files which created
5 kx # during Makefile works. For normal work all tested files should be
5 kx # created before the Makefile starting my make command.
5 kx #
5 kx $(TARGET_BUILD_DIR)/$(HARDWARE).pkglist:
5 kx ifneq ($(shell pwd),$(BUILDSYSTEM))
5 kx ifeq ($(shell pwd | grep $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR))$(shell pwd | grep $(BUILDSYSTEM)/3pp/sources),)
5 kx ifeq ($(shell pwd),$(TOP_BUILD_DIR_ABS))
5 kx @echo -e "#######"
5 kx @echo -e "####### Packages List creation in the top of '`basename $(CURDIR)`' directory is not supported."
5 kx @echo -e "#######"
5 kx else
5 kx ifeq ($(wildcard $(TARGET_BUILD_DIR)/.requires),)
5 kx @echo -e " (nothing to be done)."
5 kx @echo -e "#######"
5 kx @echo -e "####### Before creating a dependency tree all goals have to be made."
5 kx @echo -e "#######"
5 kx else
5 kx @echo -e "################################################################"
5 kx @echo -e "#######"
5 kx @echo -e "####### Start of building Packages List in '`echo $(CURDIR) | sed 's,$(TOP_BUILD_DIR_ABS)/,,'`' directory..."
5 kx @echo -e "#######"
5 kx @$(BUILDSYSTEM)/build-pkglist list $(TOP_BUILD_DIR_ABS) $(TOOLCHAIN) $(HARDWARE) $(FLAVOUR)
5 kx @echo -e "#######"
5 kx @echo -e "####### End of building Packages List in '`echo $(CURDIR) | sed 's,$(TOP_BUILD_DIR_ABS)/,,'`' directory."
5 kx @echo -e "#######"
5 kx @echo -e "################################################################"
5 kx endif
5 kx endif
5 kx endif
5 kx endif
5 kx
5 kx #######
5 kx ####### End of Build PACKAGES list.
5 kx #######
5 kx ################################################################
5 kx
5 kx
5 kx ################################################################
5 kx #######
5 kx ####### Build Devices Table:
5 kx #######
5 kx
5 kx devices_table: $(TARGET_BUILD_DIR)/.DEVTABLE
5 kx
5 kx $(TARGET_BUILD_DIR)/.DEVTABLE: $(TARGET_BUILD_DIR)/$(HARDWARE).pkglist
5 kx ifneq ($(shell pwd),$(BUILDSYSTEM))
5 kx ifeq ($(shell pwd | grep $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR))$(shell pwd | grep $(BUILDSYSTEM)/3pp/sources),)
5 kx ifeq ($(shell pwd),$(TOP_BUILD_DIR_ABS))
5 kx @echo -e "#######"
5 kx @echo -e "####### Devices Table creation in the top of '`basename $(CURDIR)`' directory is not supported."
5 kx @echo -e "#######"
5 kx else
5 kx @echo -e "################################################################"
5 kx @echo -e "#######"
5 kx @echo -e "####### Start of building Devices Table in '`echo $(CURDIR) | sed 's,$(TOP_BUILD_DIR_ABS)/,,'`' directory..."
5 kx @echo -e "#######"
5 kx @SYSTEM_VERSION=$(SYSTEM_VERSION) \
5 kx DISTRO_VERSION=$(DISTRO_VERSION) \
5 kx DISTRO_NAME=$(DISTRO_NAME) \
5 kx $(BUILDSYSTEM)/build_devices_table $(TOP_BUILD_DIR_ABS) $(TOOLCHAIN) $(HARDWARE) $(FLAVOUR)
5 kx @echo -e "#######"
5 kx @echo -e "####### End of building Devices Table in '`echo $(CURDIR) | sed 's,$(TOP_BUILD_DIR_ABS)/,,'`' directory."
5 kx @echo -e "#######"
5 kx @echo -e "################################################################"
5 kx endif
5 kx endif
5 kx endif
5 kx
5 kx #######
5 kx ####### End of Build Devices Table.
5 kx #######
5 kx ################################################################
5 kx
5 kx
5 kx ################################################################
5 kx #######
5 kx ####### Copy Packages REPO into rootfs:
5 kx #######
5 kx
5 kx packages_repo: $(ROOTFS_DEST_DIR)/var/lib/$(DISTRO_NAME)/repo/$(DISTRO_FULL_VERSION)/$(TOOLCHAIN)/$(HARDWARE)/$(HARDWARE).pkglist
5 kx
5 kx $(ROOTFS_DEST_DIR)/var/lib/$(DISTRO_NAME)/repo/$(DISTRO_FULL_VERSION)/$(TOOLCHAIN)/$(HARDWARE)/$(HARDWARE).pkglist: $(TARGET_BUILD_DIR)/$(HARDWARE).pkglist $(TARGET_BUILD_DIR)/.DEVTABLE
5 kx ifneq ($(shell pwd),$(BUILDSYSTEM))
5 kx ifeq ($(shell pwd | grep $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR))$(shell pwd | grep $(BUILDSYSTEM)/3pp/sources),)
5 kx ifeq ($(shell pwd),$(TOP_BUILD_DIR_ABS))
5 kx @echo -e "#######"
5 kx @echo -e "####### Packages REPO creation in the top of '`basename $(CURDIR)`' directory is not supported."
5 kx @echo -e "#######"
5 kx else
5 kx @echo -e "################################################################"
5 kx @echo -e "#######"
5 kx @echo -e "####### Start of copying Packages REPO in '`echo $(CURDIR) | sed 's,$(TOP_BUILD_DIR_ABS)/,,'`' directory..."
5 kx @echo -e "#######"
5 kx @mkdir -p $(ROOTFS_DEST_DIR)/var/lib/$(DISTRO_NAME)/repo/$(DISTRO_FULL_VERSION)/$(TOOLCHAIN)/$(HARDWARE)
5 kx @for dir in `find $(PRODUCTS_DEST_DIR)/ -mindepth 1 -type d -name '*'` ; do \
5 kx cp -a $${dir} $(ROOTFS_DEST_DIR)/var/lib/$(DISTRO_NAME)/repo/$(DISTRO_FULL_VERSION)/$(TOOLCHAIN)/$(HARDWARE)/ ; \
5 kx done
5 kx @cp -a $(TARGET_BUILD_DIR)/$(HARDWARE).pkglist \
5 kx $(ROOTFS_DEST_DIR)/var/lib/$(DISTRO_NAME)/repo/$(DISTRO_FULL_VERSION)/$(TOOLCHAIN)/$(HARDWARE)/
5 kx @ln -sfr $(ROOTFS_DEST_DIR)/var/lib/$(DISTRO_NAME)/repo/$(DISTRO_FULL_VERSION)/$(TOOLCHAIN)/$(HARDWARE)/$(HARDWARE).pkglist \
5 kx $(ROOTFS_DEST_DIR)/var/lib/$(DISTRO_NAME)/repo/$(DISTRO_FULL_VERSION)/$(TOOLCHAIN)/$(HARDWARE)/.pkglist
5 kx @echo -e "####### Packages REPO has been installed into 'var/lib/$(DISTRO_NAME)/repo' directory."
5 kx @echo -e "#######"
5 kx @echo -e "####### End of copying Packages REPO in '`echo $(CURDIR) | sed 's,$(TOP_BUILD_DIR_ABS)/,,'`' directory."
5 kx @echo -e "#######"
5 kx @echo -e "################################################################"
5 kx endif
5 kx endif
5 kx endif
5 kx
5 kx #######
5 kx ####### End of Copying Packages REPO.
5 kx #######
5 kx ################################################################
5 kx
5 kx
5 kx ################################################################
5 kx #######
5 kx ####### Build ext4 Root FS image:
5 kx #######
5 kx
5 kx ext4fs_image: $(TARGET_BUILD_DIR)/$(HARDWARE).ext4fs
5 kx
5 kx $(TARGET_BUILD_DIR)/$(HARDWARE).ext4fs: $(TARGET_BUILD_DIR)/.DEVTABLE $(ROOTFS_DEST_DIR)/var/lib/$(DISTRO_NAME)/repo/$(DISTRO_FULL_VERSION)/$(TOOLCHAIN)/$(HARDWARE)/$(HARDWARE).pkglist
5 kx ifneq ($(shell pwd),$(BUILDSYSTEM))
5 kx ifeq ($(shell pwd | grep $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR))$(shell pwd | grep $(BUILDSYSTEM)/3pp/sources),)
5 kx ifeq ($(shell pwd),$(TOP_BUILD_DIR_ABS))
5 kx @echo -e "#######"
5 kx @echo -e "####### Ext4 Root FS Image creation in the top of '`basename $(CURDIR)`' directory is not supported."
5 kx @echo -e "#######"
5 kx else
5 kx @echo -e "################################################################"
5 kx @echo -e "#######"
5 kx @echo -e "####### Start of building Ext4 Root FS Image in '`echo $(CURDIR) | sed 's,$(TOP_BUILD_DIR_ABS)/,,'`' directory..."
5 kx @echo -e "#######"
5 kx @( size=`echo $(MAKEFLAGS) | grep 'size=' | sed -e 's,.*size=\([0-9.]*[KMG]\?\).*,\1,'` ; \
5 kx if [ -z "$$size" ] ; then \
5 kx sizeoption="" ; \
5 kx else \
5 kx sizeoption="--size=$$size" ; \
5 kx fi ; \
5 kx MKEE4FS=$(MKE4FS) E4FSCK=$(E4FSCK) POPULATEFS=$(POPULATEFS) \
5 kx $(BUILDSYSTEM)/build_ext4fs $$sizeoption $(TOP_BUILD_DIR_ABS) $(TOOLCHAIN) $(HARDWARE) $(FLAVOUR) ; \
5 kx )
5 kx @echo -e "#######"
5 kx @echo -e "####### End of building Ext4 Root FS Image in '`echo $(CURDIR) | sed 's,$(TOP_BUILD_DIR_ABS)/,,'`' directory."
5 kx @echo -e "#######"
5 kx @echo -e "################################################################"
5 kx endif
5 kx endif
5 kx endif
5 kx
5 kx #######
5 kx ####### End of Build ext4 Root FS image.
5 kx #######
5 kx ################################################################
5 kx
5 kx
5 kx ################################################################
5 kx #######
5 kx ####### Install $(HARDWARE).{pkglist,ext4fs,SD.MBR} into products directory:
5 kx #######
5 kx
5 kx products_release: $(PRODUCTS_DEST_DIR)/$(HARDWARE).pkglist \
5 kx $(PRODUCTS_DEST_DIR)/$(HARDWARE).ext4fs
5 kx
5 kx $(PRODUCTS_DEST_DIR)/$(HARDWARE).ext4fs: $(TARGET_BUILD_DIR)/$(HARDWARE).ext4fs
5 kx ifneq ($(shell pwd),$(BUILDSYSTEM))
5 kx ifeq ($(shell pwd | grep $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR))$(shell pwd | grep $(BUILDSYSTEM)/3pp/sources),)
5 kx ifeq ($(shell pwd),$(TOP_BUILD_DIR_ABS))
5 kx @echo -e "#######"
5 kx @echo -e "####### Installation of Ext4 Root FS Image from the top of '`basename $(CURDIR)`' directory is not supported."
5 kx @echo -e "#######"
5 kx else
5 kx @echo -e "################################################################"
5 kx @echo -e "#######"
5 kx @echo -e "####### Installing the Ext4 Root FS Image into '`echo $(PRODUCTS_DEST_DIR) | sed 's,$(TOP_BUILD_DIR_ABS)/,,'`' directory..."
5 kx @echo -e "#######"
5 kx @cp -a $(TARGET_BUILD_DIR)/$(HARDWARE).SD.MBR $(PRODUCTS_DEST_DIR)/$(HARDWARE).SD.MBR
5 kx @cp -a $(TARGET_BUILD_DIR)/$(HARDWARE).ext4fs $(PRODUCTS_DEST_DIR)/$(HARDWARE).ext4fs
5 kx @$(E4FSCK) -fy $(PRODUCTS_DEST_DIR)/$(HARDWARE).ext4fs
5 kx @if [ -s $(PRODUCTS_DEST_DIR)/$(HARDWARE).boot-records ] ; then \
5 kx $(DD) if=$(TARGET_BUILD_DIR)/$(HARDWARE).SD.MBR \
5 kx of=$(PRODUCTS_DEST_DIR)/$(HARDWARE).boot-records \
5 kx bs=1 skip=446 seek=446 count=66 conv=notrunc 1> /dev/null 2> /dev/null ; \
5 kx fi
5 kx @if [ -s $(PRODUCTS_DEST_DIR)/$(HARDWARE).grub-records ] ; then \
5 kx $(DD) if=$(TARGET_BUILD_DIR)/$(HARDWARE).SD.MBR \
5 kx of=$(PRODUCTS_DEST_DIR)/$(HARDWARE).grub-records \
5 kx bs=1 skip=446 seek=446 count=66 conv=notrunc 1> /dev/null 2> /dev/null ; \
5 kx fi
5 kx @if [ -s $(PRODUCTS_DEST_DIR)/$(HARDWARE).efi32fs ] ; then \
5 kx rm -f $(PRODUCTS_DEST_DIR)/$(HARDWARE).SD.MBR ; \
5 kx cp -a $(BUILDSYSTEM)/write-efiboot-image $(PRODUCTS_DEST_DIR) ; \
5 kx cp -a $(BUILDSYSTEM)/usr/share/pkgtools/.dialogrc $(PRODUCTS_DEST_DIR) ; \
5 kx fi
5 kx @echo -e "#######"
5 kx @echo -e "####### End of installing Ext4 Root FS Image into '`echo $(PRODUCTS_DEST_DIR) | sed 's,$(TOP_BUILD_DIR_ABS)/,,'`' directory."
5 kx @echo -e "#######"
5 kx @echo -e "################################################################"
5 kx endif
5 kx endif
5 kx endif
5 kx
5 kx $(PRODUCTS_DEST_DIR)/$(HARDWARE).pkglist: $(TARGET_BUILD_DIR)/$(HARDWARE).pkglist
5 kx ifneq ($(shell pwd),$(BUILDSYSTEM))
5 kx ifeq ($(shell pwd | grep $(TOP_BUILD_DIR_ABS)/$(SRC_PACKAGE_DIR))$(shell pwd | grep $(BUILDSYSTEM)/3pp/sources),)
5 kx ifeq ($(shell pwd),$(TOP_BUILD_DIR_ABS))
5 kx @echo -e "#######"
5 kx @echo -e "####### Installation of Packages List from the top of '`basename $(CURDIR)`' directory is not supported."
5 kx @echo -e "#######"
5 kx else
5 kx @echo -e "################################################################"
5 kx @echo -e "#######"
5 kx @echo -e "####### Installing the Packages List into '`echo $(PRODUCTS_DEST_DIR) | sed 's,$(TOP_BUILD_DIR_ABS)/,,'`' directory..."
5 kx @echo -e "#######"
5 kx @mkdir -p $(PRODUCTS_DEST_DIR)
5 kx @cp -a $(TARGET_BUILD_DIR)/$(HARDWARE).pkglist \
5 kx $(PRODUCTS_DEST_DIR)
5 kx @( cd $(PRODUCTS_DEST_DIR) ; \
5 kx ln -sf $(HARDWARE).pkglist .pkglist ; \
5 kx )
5 kx @echo -e "#######"
5 kx @echo -e "####### Packages List has been installed into '`echo $(PRODUCTS_DEST_DIR) | sed 's,$(TOP_BUILD_DIR_ABS)/,,'`' directory."
5 kx @echo -e "#######"
5 kx @echo -e "################################################################"
5 kx endif
5 kx endif
5 kx endif
5 kx
5 kx #######
5 kx ####### End of Install $(HARDWARE).{pkglist,ext4fs,SD.MBR}.
5 kx #######
5 kx ################################################################
5 kx
5 kx
5 kx #######
5 kx ####### Install rules:
5 kx #######
5 kx
5 kx ifdef SCRIPT_TARGETS
5 kx _install_scripts := .install_scripts
5 kx endif
5 kx
5 kx ifdef BIN_TARGETS
5 kx _install_bins := .install_bins
5 kx endif
5 kx
5 kx ifdef BUILD_TARGETS
5 kx _install_builds := .install_builds
5 kx endif
5 kx
5 kx ifdef PRODUCT_TARGETS
5 kx _install_products := .install_products
5 kx endif
5 kx
5 kx ifdef ROOTFS_TARGETS
5 kx _install_pkgs := .install_pkgs
5 kx endif
5 kx
5 kx ifdef ROOTFS_UPDATE_TARGETS
5 kx _update_pkgs := .update_pkgs
5 kx endif
5 kx
5 kx
5 kx ################################################################
5 kx #######
5 kx ####### Waiting for build whole required tree:
5 kx #######
5 kx
5 kx $(BUILD_TARGETS) : | $(_tree)
5 kx
5 kx #######
5 kx ####### End of waiting for build whole required tree.
5 kx #######
5 kx ################################################################
5 kx
5 kx
5 kx $(PRODUCT_TARGETS) : | $(BUILD_TARGETS)
5 kx $(ROOTFS_TARGETS) : | $(BUILD_TARGETS)
5 kx $(ROOTFS_UPDATE_TARGETS) : | $(BUILD_TARGETS)
5 kx
5 kx
5 kx
5 kx _install: .install
5 kx @if [ "$$(echo $(TARGET_BUILD_DIR)/.dist*)" != "$(TARGET_BUILD_DIR)/.dist*" ]; then \
5 kx sort -o $(TARGET_BUILD_DIR)/.dist.tmp -u $(TARGET_BUILD_DIR)/.dist* ; \
5 kx mv $(TARGET_BUILD_DIR)/.dist.tmp $(TARGET_BUILD_DIR)/.dist ; \
5 kx fi
5 kx @rm -f $(TARGET_BUILD_DIR)/.dist.*
5 kx
5 kx
5 kx
5 kx .install: $(_install_scripts)
5 kx .install: $(_install_bins)
5 kx .install: $(_install_builds)
5 kx .install: $(_install_products)
5 kx .install: $(_install_pkgs)
5 kx .install: $(_update_pkgs)
5 kx
5 kx
5 kx # create files which contains the list of installed files
5 kx .install_%: DO_CREATE_DIST_FILES = $(CREATE_DIST_FILES)
5 kx export DO_CREATE_DIST_FILES
5 kx
5 kx
5 kx #
5 kx # Note:
5 kx # The check such as 'ifdef SCRIPT_TARGETS' realy doesn't need. This
5 kx # practice can be used in other cases, for example, if we will need
5 kx # to check some variables used in the following commands.
5 kx # As example only, we can check existence of FLAVOUR variable:
5 kx #
5 kx # $(_install_scripts): $(SCRIPT_TARGETS)
5 kx # ifdef FLAVOUR
5 kx # @$(BUILDSYSTEM)/install_targets $^ $(TARGET_DEST_DIR)/bin $(HARDWARE) $(FLAVOUR)
5 kx # else
5 kx # @$(BUILDSYSTEM)/install_targets $^ $(TARGET_DEST_DIR)/bin $(HARDWARE)
5 kx # endif
5 kx #
5 kx $(_install_scripts): $(SCRIPT_TARGETS)
5 kx ifdef SCRIPT_TARGETS
5 kx @$(BUILDSYSTEM)/install_targets \
5 kx --destination=$(TARGET_DEST_DIR)/bin \
5 kx --toolchain=$(TOOLCHAIN) \
5 kx --hardware=$(HARDWARE) \
5 kx --flavour=$(FLAVOUR) \
5 kx $^
5 kx endif
5 kx
5 kx $(_install_bins): $(BIN_TARGETS)
5 kx ifdef BIN_TARGETS
5 kx @$(BUILDSYSTEM)/install_targets \
5 kx --destination=$(TARGET_DEST_DIR)/bin \
5 kx --toolchain=$(TOOLCHAIN) \
5 kx --hardware=$(HARDWARE) \
5 kx --flavour=$(FLAVOUR) \
5 kx $^
5 kx endif
5 kx
5 kx $(_install_builds): $(BUILD_TARGETS)
5 kx ifdef BUILD_TARGETS
5 kx # Do nothing
5 kx endif
5 kx
5 kx # preserve source dir with depth=1 ; then collect installed products in the .$(HARDWARE).products file
5 kx $(_install_products): $(PRODUCT_TARGETS)
5 kx ifdef PRODUCT_TARGETS
5 kx @$(BUILDSYSTEM)/install_targets \
5 kx --preserve-source-dir=$(if $(FLAVOUR),two,one) \
5 kx --destination=$(PRODUCTS_DEST_DIR) \
5 kx --toolchain=$(TOOLCHAIN) \
5 kx --hardware=$(HARDWARE) \
5 kx --flavour=$(FLAVOUR) \
5 kx $^
5 kx endif
5 kx
5 kx #
5 kx # NOTE:
5 kx # We use CWD=$(CURDIR) as a directory for collect .$(HARDWARE).rootfs.* files, also
5 kx # to allow parallel installation the 'install_pkgs' script install packages from
5 kx # $(TARGET_BUILD_DIR)/$(PKG_GROUP) directory. In other words if ROOTFS_TARGETS equal to
5 kx #
5 kx # ROOTFS_TARGETS = $(TARGET_BUILD_DIR)/$(PKG_GROUP)/$(pkg_basename).txz
5 kx #
5 kx # then 'install_pkgs' going to $(TARGET_BUILD_DIR)/$(PKG_GROUP) directory and installs
5 kx # the $(pkg_basename).txz package directly from this directory to keep temporary files
5 kx # separately from other HARDWAREs. In this case we need to use CWD environment variable
5 kx # to set the directory where the .$(HARDWARE).rootfs.* files will be collected by
5 kx # 'install_pkgs' script (see the 'install_pkgs' source code).
5 kx #
5 kx # Parallel installation when ROOTFS_TARGETS presents not alone package not tested.
5 kx #
5 kx $(_install_pkgs): $(ROOTFS_TARGETS)
5 kx ifdef ROOTFS_TARGETS
5 kx @echo -e "#######"
5 kx @echo -e "####### Install packages into 'dist/rootfs/$(TOOLCHAIN)/$(HARDWARE)/...' file system..."
5 kx @echo -e "#######"
5 kx ifeq ($(wildcard $(TARGET_BUILD_DIR)/.rootfs),)
5 kx @CWD=$(CURDIR) INSTALL_PACKAGE="$(INSTALL_PACKAGE)" \
5 kx $(BUILDSYSTEM)/install_pkgs --destination=$(ROOTFS_DEST_DIR) \
5 kx --toolchain=$(TOOLCHAIN) \
5 kx --hardware=$(HARDWARE) \
5 kx --flavour=$(FLAVOUR) \
5 kx $^
5 kx else
5 kx @echo ""
5 kx @for pkg in $(ROOTFS_TARGETS) ; do \
5 kx echo -e "####### ... package `basename $$pkg` is already installed." ; \
5 kx done
5 kx @echo ""
5 kx endif
5 kx endif
5 kx
5 kx
5 kx $(_update_pkgs): $(ROOTFS_UPDATE_TARGETS)
5 kx ifdef ROOTFS_UPDATE_TARGETS
5 kx @echo -e "#######"
5 kx @echo -e "####### Update packages into 'dist/rootfs/$(TOOLCHAIN)/$(HARDWARE)/...' file system..."
5 kx @echo -e "#######"
5 kx ifeq ($(wildcard $(TARGET_BUILD_DIR)/.rootfs),)
5 kx @CWD=$(CURDIR) UPDATE_PACKAGE="$(UPDATE_PACKAGE)" \
5 kx $(BUILDSYSTEM)/update_pkgs --destination=$(ROOTFS_DEST_DIR) \
5 kx --toolchain=$(TOOLCHAIN) \
5 kx --hardware=$(HARDWARE) \
5 kx --flavour=$(FLAVOUR) \
5 kx $^
5 kx else
5 kx @echo ""
5 kx @for pkg in $(ROOTFS_UPDATE_TARGETS) ; do \
5 kx echo -e "####### ... package `basename $$pkg` is already installed." ; \
5 kx done
5 kx @echo ""
5 kx endif
5 kx endif
5 kx
5 kx
5 kx
5 kx
5 kx
5 kx ################################################################
5 kx #######
5 kx ####### Generic Rules Section:
5 kx #######
5 kx
5 kx # link rule, used to build binaries
5 kx # $(target): $(objs)
5 kx # $(LINK)
5 kx #
5 kx
5 kx LINKER = $(if $(filter .cpp,$(suffix $(SRCS))),$(CXX_LINKER),$(CC_LINKER))
5 kx
5 kx ifeq ($(COMPONENT_IS_3PP),)
5 kx LINKMAP = -Wl,-Map,$@.linkmap
5 kx endif
5 kx
5 kx BASIC_LDOPTS = $(ARCH_FLAGS) $(LDFLAGS) $(LINKMAP)
5 kx BASIC_LDOPTS += -o $@ $(filter %.o,$^)
5 kx
5 kx
5 kx define cmdheader
5 kx @echo -e ""
5 kx @echo -e "======= $(1) ======="
5 kx $(2)
5 kx @echo -e ""
5 kx endef
5 kx
5 kx
5 kx LINK = $(call cmdheader,"Linking $@",$(LINKER) $(BASIC_LDOPTS))
5 kx
5 kx # LINK_C overrides the automatic linker selection provided with LINK
5 kx # and always uses gcc. Useful when building both C and C++ targets
5 kx # in the same component:
5 kx LINK_C = $(call cmdheader,"Linking $@",$(CC) $(BASIC_LDOPTS))
5 kx
5 kx LINK_SO = $(call cmdheader,"Linking $@", $(LINKER) $(BASIC_LDOPTS) -shared)
5 kx
5 kx LINK_A = $(call cmdheader,"Building $@",$(AR) cru $@ $^)
5 kx
5 kx
5 kx #######
5 kx ####### Source dependency
5 kx #######
5 kx
5 kx flatfile = $(subst /,_,$(subst ./,,$(1)))
5 kx DEPFILE = $(patsubst %.o,%.d,$(if $(findstring $(TOOLCHAIN),$@),$(TARGET_BUILD_DIR)/$(call flatfile,$(subst $(TARGET_BUILD_DIR)/,,$@)),$(call flatfile,$@)))
5 kx DEPSETUP = -MD -MP -MF $(DEPFILE) -MT $@
5 kx
5 kx ####### .cpp -> .o
5 kx %.o: %.cpp
5 kx @echo -e ""
5 kx @echo -e "======= $< -> $@ ======="
5 kx $(quiet)$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) -o $@ $(DEPSETUP) $<
5 kx
5 kx $(TARGET_BUILD_DIR)/%.o: %.cpp
5 kx @echo -e "\n======= $< -> $@ ======="
5 kx @mkdir -p $(dir $@)
5 kx $(quiet)$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) -o $@ $(DEPSETUP) $<
5 kx
5 kx ####### .c -> .o
5 kx %.o: %.c
5 kx @echo -e ""
5 kx @echo -e "======= $< -> $@ ======="
5 kx $(quiet)$(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $(DEPSETUP) $<
5 kx
5 kx $(TARGET_BUILD_DIR)/%.o: %.c
5 kx @echo -e "======= $< -> $@ ======="
5 kx @mkdir -p $(dir $@)
5 kx $(quiet)$(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $(DEPSETUP) $<
5 kx
5 kx #######
5 kx ####### Generic Rules Section.
5 kx #######
5 kx ################################################################
5 kx
5 kx
5 kx
5 kx #######
5 kx ####### NOTE: Include dependencies should be in section where
5 kx ####### the symbol __final__ is defined: ifneq ($(__final__),)
5 kx #######
5 kx
5 kx #######
5 kx ####### Include dependencies if they exist
5 kx #######
5 kx
5 kx -include $(targetflavour)/*.d
5 kx
5 kx # Include HW dependencies
5 kx -include $(TARGET_BUILD_DIR)/.requires_depend
5 kx
5 kx #######
5 kx ####### Include sources dependency if they exist
5 kx #######
5 kx
5 kx -include .src_requires_depend
5 kx
5 kx
5 kx
5 kx ################################################################
5 kx #######
5 kx ####### HW depended macro for create PKG requires:
5 kx #######
5 kx BUILD_PKG_REQUIRES = $(BUILDSYSTEM)/build_pkg_requires --toolchain=$(TOOLCHAIN) --hardware=$(HARDWARE) --flavour=$(FLAVOUR) $(REQUIRES)
5 kx BUILD_ALL_PKG_REQUIRES = $(BUILDSYSTEM)/build_pkg_requires --toolchain=$(TOOLCHAIN) --hardware=$(HARDWARE) --flavour=$(FLAVOUR) --pkg-type=all $(REQUIRES)
5 kx BUILD_BIN_PKG_REQUIRES = $(BUILDSYSTEM)/build_pkg_requires --toolchain=$(TOOLCHAIN) --hardware=$(HARDWARE) --flavour=$(FLAVOUR) --pkg-type=bin $(REQUIRES)
5 kx BUILD_DEV_PKG_REQUIRES = $(BUILDSYSTEM)/build_pkg_requires --toolchain=$(TOOLCHAIN) --hardware=$(HARDWARE) --flavour=$(FLAVOUR) --pkg-type=dev $(REQUIRES)
5 kx #######
5 kx ####### HW depended macro for create PKG requires.
5 kx #######
5 kx ################################################################
5 kx
5 kx
5 kx endif
5 kx #
5 kx # end of ifeq ($(__final__),)
5 kx #
5 kx ################################################################
5 kx
5 kx
5 kx
5 kx
5 kx # HW depended targets:
5 kx .PHONY: .target*
5 kx
5 kx .PHONY: .toolchain
5 kx
5 kx .PHONY: $(_tree)
5 kx .PHONY: .requires_makefile
5 kx
5 kx .PHONY: .tree_all .tree_clean .tree_dist_clean .tree_rootfs_clean
5 kx .PHONY: all _install clean dist_clean rootfs_clean
5 kx .PHONY: local_all local_clean local_dist_clean local_rootfs_clean
5 kx .PHONY: .local_clean .local_dist_clean .local_rootfs_clean
5 kx
5 kx .PHONY: .install $(_install_scripts) $(_install_builds) $(_install_bins) $(_install_products)
5 kx .PHONY: $(_install_pkgs) $(_update_pkgs)
5 kx
5 kx # HW independed targets:
5 kx .PHONY: help
5 kx .PHONY: .setup
5 kx .PHONY: .sources .build_system
5 kx .PHONY: global_clean downloads_clean
5 kx .PHONY: .global_clean .downloads_clean
5 kx
5 kx .SUFFIXES:
5 kx
5 kx
5 kx
5 kx CORE_MK = 1
5 kx endif