deal with static kernel
[buildroot.git] / toolchain / dependencies / dependencies.mk
blob53a8f1974331cea5b03375caf28f4d1cec308d05
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 [ "x$(V)" != "x" ] && diff -u $@ $@.new; \
41 mv $@.new $@; \
42 set -e; \
43 HOSTCC="$(firstword $(HOSTCC))" MAKE="$(MAKE)" \
44 HOST_SED_DIR="$(HOST_SED_DIR)" \
45 NEED_RUBY="$(NEED_RUBY)" \
46 NEED_NASM="$(NEED_NASM)" \
47 $(TOPDIR)/toolchain/dependencies/dependencies.sh; \
48 $(MAKE1) host-sed $(DEPENDENCIES_HOST_PREREQ); \
49 touch -c $@; \
52 do-dependencies: $(dependencies)
53 @HOSTCC="$(firstword $(HOSTCC))" MAKE="$(MAKE)" \
54 HOST_SED_DIR="$(HOST_SED_DIR)" \
55 NEED_RUBY="$(NEED_RUBY)" \
56 NEED_NASM="$(NEED_NASM)" \
57 $(TOPDIR)/toolchain/dependencies/dependencies.sh
58 $(MAKE1) host-sed $(DEPENDENCIES_HOST_PREREQ)
60 dependencies-source: $(ENV_DEP_HOST_SOURCE)
62 dependencies-clean: sstrip_target-clean sstrip_host-clean host-sed-clean \
63 host-nasm-clean
64 rm -f $(ENV_DEP_HOST) $(dependencies)
66 dependencies-dirclean:
67 @true
69 #############################################################
71 # Toplevel Makefile options
73 #############################################################