diff --git a/kernel/Makefile b/kernel/Makefile
index 0026cf5317690c9df47d38222db5df16ab8e9bf1..dc5c77544fd69f6924adc25c3f4a8d3530708392 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -105,7 +105,7 @@ targets += config_data.gz
 $(obj)/config_data.gz: $(KCONFIG_CONFIG) FORCE
 	$(call if_changed,gzip)
 
-      filechk_ikconfiggz = (echo "static const char kernel_config_data[] __used = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;")
+      filechk_ikconfiggz = (echo "static const char kernel_config_data[] __used = MAGIC_START"; cat $< | scripts/basic/bin2c; echo "MAGIC_END;")
 targets += config_data.h
 $(obj)/config_data.h: $(obj)/config_data.gz FORCE
 	$(call filechk,ikconfiggz)
diff --git a/scripts/.gitignore b/scripts/.gitignore
index fb070fa1038feb51e47db9c4ec807ee328fe6364..5ecfe93f2028712afa413dba6f67c72e1ce0930e 100644
--- a/scripts/.gitignore
+++ b/scripts/.gitignore
@@ -4,7 +4,6 @@
 conmakehash
 kallsyms
 pnmtologo
-bin2c
 unifdef
 ihex2fw
 recordmcount
diff --git a/scripts/Makefile b/scripts/Makefile
index 890df5c6adfbc16769a4abcb27bb3860fc625e71..72902b5f27213696604f077bc8ad78e8f82d9bd0 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -13,7 +13,6 @@ HOST_EXTRACFLAGS += -I$(srctree)/tools/include
 hostprogs-$(CONFIG_KALLSYMS)     += kallsyms
 hostprogs-$(CONFIG_LOGO)         += pnmtologo
 hostprogs-$(CONFIG_VT)           += conmakehash
-hostprogs-$(CONFIG_IKCONFIG)     += bin2c
 hostprogs-$(BUILD_C_RECORDMCOUNT) += recordmcount
 hostprogs-$(CONFIG_BUILDTIME_EXTABLE_SORT) += sortextable
 hostprogs-$(CONFIG_ASN1)	 += asn1_compiler
diff --git a/scripts/basic/.gitignore b/scripts/basic/.gitignore
index a776371a350243330b14dc87b636146ba4ef2b16..9528ec9e5adc4a89e901f3e9cdfe6140f8452573 100644
--- a/scripts/basic/.gitignore
+++ b/scripts/basic/.gitignore
@@ -1 +1,2 @@
 fixdep
+bin2c
diff --git a/scripts/basic/Makefile b/scripts/basic/Makefile
index 4fcef87bb8759894435a395224c7d92cd7a14214..afbc1cd69ac5f30bcc4c93173215818dc9e169ba 100644
--- a/scripts/basic/Makefile
+++ b/scripts/basic/Makefile
@@ -9,6 +9,7 @@
 # fixdep: 	 Used to generate dependency information during build process
 
 hostprogs-y	:= fixdep
+hostprogs-$(CONFIG_IKCONFIG)     += bin2c
 always		:= $(hostprogs-y)
 
 # fixdep is needed to compile other host programs
diff --git a/scripts/bin2c.c b/scripts/basic/bin2c.c
similarity index 88%
rename from scripts/bin2c.c
rename to scripts/basic/bin2c.c
index 96dd2bcbb4072c4e43ff9ff1196a35b6fdcaa27e..af187e695345f2b26046832a7a2aff2af681e739 100644
--- a/scripts/bin2c.c
+++ b/scripts/basic/bin2c.c
@@ -11,7 +11,7 @@
 
 int main(int argc, char *argv[])
 {
-	int ch, total=0;
+	int ch, total = 0;
 
 	if (argc > 1)
 		printf("const char %s[] %s=\n",
@@ -19,10 +19,9 @@ int main(int argc, char *argv[])
 
 	do {
 		printf("\t\"");
-		while ((ch = getchar()) != EOF)
-		{
+		while ((ch = getchar()) != EOF) {
 			total++;
-			printf("\\x%02x",ch);
+			printf("\\x%02x", ch);
 			if (total % 16 == 0)
 				break;
 		}