9
0
Fork 0

Make generated variables static

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Alexander Shiyan 2014-02-01 12:07:48 +04:00 committed by Sascha Hauer
parent f9b266ec40
commit 8462cd6c32
2 changed files with 5 additions and 5 deletions

View File

@ -110,7 +110,7 @@ targets += barebox_default_env.lzo barebox_default_env.bz2 barebox_default_env.g
quiet_cmd_env_h = ENVH $@
cmd_env_h = cat $< | (cd $(obj) && $(objtree)/scripts/bin2c default_environment) > $@; \
echo "const int default_environment_uncompress_size=`stat -c%s $(obj)/barebox_default_env`;" >> $@
echo "static const int default_environment_uncompress_size=`stat -c%s $(obj)/barebox_default_env`;" >> $@
$(obj)/barebox_default_env.h: $(obj)/barebox_default_env$(barebox_default_env_comp) FORCE
$(call if_changed,env_h)
@ -119,14 +119,14 @@ quiet_cmd_pwd_h = PWDH $@
ifdef CONFIG_PASSWORD
ifneq ($(CONFIG_PASSWORD_DEFAULT),"")
PASSWD_FILE := $(shell cd $(srctree); find $(CONFIG_PASSWORD_DEFAULT) -type f)
cmd_pwd_h = echo -n "const char default_passwd[] = \"" > $@; \
cmd_pwd_h = echo -n "static const char default_passwd[] = \"" > $@; \
cat $< | tr -d '\n' >> $@; \
echo "\";" >> $@
include/generated/passwd.h: $(PASSWD_FILE)
$(call if_changed,pwd_h)
else
cmd_pwd_h = echo "const char default_passwd[] = \"\";" > $@
cmd_pwd_h = echo "static const char default_passwd[] = \"\";" > $@
include/generated/passwd.h: FORCE
$(call if_changed,pwd_h)

View File

@ -14,7 +14,7 @@ int main(int argc, char *argv[])
int ch, total=0;
if (argc > 1)
printf("const char %s[] %s=\n",
printf("static const char %s[] %s=\n",
argv[1], argc > 2 ? argv[2] : "");
do {
@ -30,7 +30,7 @@ int main(int argc, char *argv[])
} while (ch != EOF);
if (argc > 1)
printf("\t;\n\nconst int %s_size = %d;\n", argv[1], total);
printf("\t;\n\nstatic const int %s_size = %d;\n", argv[1], total);
return 0;
}