fix dependencies
[buildroot.git] / toolchain / dependencies / dependencies.mk
blobb0517eab95d51b0bc7ff6fef9a9ea4dbe26b4a9c
1 ######################################################################
3 # Check buildroot dependencies and bail out if the user's
4 # system is judged to be lacking....
6 ######################################################################
8 DEPENDENCIES_HOST_PREREQ:=
9 ifeq ($(BR2_STRIP_sstrip),y)
10 DEPENDENCIES_HOST_PREREQ+=sstrip_host
11 endif
12 ifneq ($(findstring y,$(BR2_KERNEL_HEADERS_LZMA)),)
13 DEPENDENCIES_HOST_PREREQ+=host-lzma
14 endif
16 # grub2 needs ruby to generate its Makefiles. brrr
17 ifeq ($(BR2_TARGET_GRUB2),y)
18 NEED_RUBY:=y
19 endif
20 ifeq ($(findstring y,$(BR2_TARGET_SYSLINUX)$(BR2_TARGET_PXELINUX)),y)
21 NEED_NASM:=y
22 DEPENDENCIES_HOST_PREREQ+=host-nasm
23 endif
25 # We record the environ of the caller to see if we have to recheck
26 # via dependencies.sh.
27 dependencies:=.br.dependencies.host
29 ENV_DEP_HOST:=$(TOOL_BUILD_DIR)/bin/env.host
30 ENV_DEP_HOST_SOURCE:=$(TOPDIR)/toolchain/dependencies/env.c
31 $(ENV_DEP_HOST): $(ENV_DEP_HOST_SOURCE)
32 @$(INSTALL) -d $(@D)
33 @$(HOSTCC) $(HOST_CFLAGS) $(ENV_DEP_HOST_SOURCE) -o $@
35 $(dependencies): $(ENV_DEP_HOST) .config
36 @$(ENV_DEP_HOST) > $@.new
37 $(Q)if cmp $@ $@.new > /dev/null 2>&1; then \
38 rm -f $@.new; \
39 else \
40 mv $@.new $@; \
41 set -e; \
42 HOSTCC="$(firstword $(HOSTCC))" MAKE="$(MAKE)" \
43 HOST_SED_DIR="$(HOST_SED_DIR)" \
44 NEED_RUBY="$(NEED_RUBY)" \
45 NEED_NASM="$(NEED_NASM)" \
46 $(TOPDIR)/toolchain/dependencies/dependencies.sh; \
47 $(MAKE1) host-sed $(DEPENDENCIES_HOST_PREREQ); \
48 touch -c $@; \
50 @echo 'done.'
51 @echo ''
53 do-dependencies: $(dependencies)
54 @HOSTCC="$(firstword $(HOSTCC))" MAKE="$(MAKE)" \
55 HOST_SED_DIR="$(HOST_SED_DIR)" \
56 NEED_RUBY="$(NEED_RUBY)" \
57 NEED_NASM="$(NEED_NASM)" \
58 $(TOPDIR)/toolchain/dependencies/dependencies.sh
59 $(MAKE1) host-sed $(DEPENDENCIES_HOST_PREREQ)
61 dependencies-source: $(ENV_DEP_HOST_SOURCE)
63 dependencies-clean: sstrip_target-clean sstrip_host-clean host-sed-clean \
64 host-nasm-clean
65 rm -f $(ENV_DEP_HOST) $(dependencies)
67 dependencies-dirclean:
68 @true
70 #############################################################
72 # Toplevel Makefile options
74 #############################################################