diff mbox

[3/5] Makefile: Generate error_strings.h

Message ID 1379459317-13046-4-git-send-email-daniel.santos@pobox.com (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Santos Sept. 17, 2013, 11:08 p.m. UTC
This is an initial attempt and needs improvement.  Ideally,
error_strings.h should only be generated when STRERROR or STRERROR_NAME
are enabled. This implementation also fails to remake error_strings.h
when arch-specific dependencies change.  Also, I've noticed that this
implementation fails to output a message when it's running, so help with
this would be appreciated.

Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
---
 Makefile | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 8243a23..38049ca 100644
--- a/Makefile
+++ b/Makefile
@@ -835,7 +835,7 @@  endif
 prepare2: prepare3 outputmakefile asm-generic
 
 prepare1: prepare2 $(version_h) include/generated/utsrelease.h \
-                   include/config/auto.conf
+                   include/config/auto.conf include/generated/error_strings.h
 	$(cmd_crmodverdir)
 
 archprepare: archheaders archscripts prepare1 scripts_basic
@@ -873,6 +873,13 @@  $(version_h): $(srctree)/Makefile FORCE
 include/generated/utsrelease.h: include/config/kernel.release FORCE
 	$(call filechk,utsrelease.h)
 
+include/generated/error_strings.h: include/uapi/asm-generic/errno-base.h \
+				   include/uapi/asm-generic/errno.h \
+				   include/uapi/linux/errno.h \
+				   include/linux/errno.h
+	$(shell ARCH=$(ARCH) $(srctree)/scripts/mkstrerror.sh \
+			> $(srctree)/include/generated/error_strings.h)
+
 PHONY += headerdep
 headerdep:
 	$(Q)find $(srctree)/include/ -name '*.h' | xargs --max-args 1 \