# scripts contains sources for various helper programs used throughout
# the kernel for the build process.
# ---------------------------------------------------------------------------
-# fix-dep: Used to generate dependency information during build process
-# split-include: Divide all config symbols up in a number of files in
-# include/config/...
-# docproc: Preprocess .tmpl file in order to generate .sgml documentation
+# kallsyms: Find all symbols in vmlinux
+# pnmttologo: Convert pnm files to logo files
+# conmakehash: Create chartable
# conmakehash: Create arrays for initializing the kernel console tables
+# docproc: Used in Documentation/DocBook
-EXTRA_TARGETS := fixdep split-include docproc conmakehash
+HOST_EXTRACFLAGS += -I$(srctree)/tools/include
-subdir- := lxdialog kconfig
+hostprogs-$(CONFIG_KALLSYMS) += kallsyms
+hostprogs-$(CONFIG_LOGO) += pnmtologo
+hostprogs-$(CONFIG_VT) += conmakehash
+hostprogs-$(CONFIG_IKCONFIG) += bin2c
+hostprogs-$(BUILD_C_RECORDMCOUNT) += recordmcount
-# Yikes. We need to build this stuff here even if the user only wants
-# modules.
+always := $(hostprogs-y) $(hostprogs-m)
-KBUILD_BUILTIN := 1
+# The following hostprogs-y programs are only build on demand
+hostprogs-y += unifdef docproc
-# The following temporary rule will make sure that people's
-# trees get updated to the right permissions, since patch(1)
-# can't do it
-# ---------------------------------------------------------------------------
-
-host-progs := fixdep split-include conmakehash docproc
-
-include $(TOPDIR)/Rules.make
+# These targets are used internally to avoid "is up to date" messages
+PHONY += build_unifdef
+build_unifdef: scripts/unifdef FORCE
+ @:
+build_docproc: scripts/docproc FORCE
+ @:
+subdir-$(CONFIG_MODVERSIONS) += genksyms
+subdir-y += mod
+subdir-$(CONFIG_SECURITY_SELINUX) += selinux
+subdir-$(CONFIG_DTC) += dtc
-# ---------------------------------------------------------------------------
-# Targets hardcoded and wellknow in top-level makefile
-.PHONY: lxdialog
-lxdialog:
- $(call descend,scripts/lxdialog,)
-
-# fixdep is needed to compile other host programs
-$(obj)/split-include $(obj)/docproc \
-$(obj)/conmakehash lxdialog: $(obj)/fixdep
+# Let clean descend into subdirs
+subdir- += basic kconfig package selinux