From: Michal Sojka Date: Sat, 17 Oct 2015 14:01:54 +0000 (+0200) Subject: Move parse_kconfig invocation from .py to Makefile X-Git-Url: https://rtime.felk.cvut.cz/gitweb/linux-conf-perf.git/commitdiff_plain/33f6327156e3aafb4d317521fa9ace888ff63b47?ds=sidebyside Move parse_kconfig invocation from .py to Makefile It's more understandable. --- diff --git a/Makefile b/Makefile index 70e1a78..c5e6507 100644 --- a/Makefile +++ b/Makefile @@ -64,11 +64,14 @@ test: scripts/parse_kconfig/parse .stamp/initram_cyclictest HELP+="run - Executes loop of kernel building, booting and benchmark execution.\n" .PHONY: run -run: all - mkdir -p $(CONF_BUILD_FOLDER) +run: all $(CONF_BUILD_FOLDER)/rules mkdir -p $(CONF_LOG_FOLDER) scripts/loop.py +$(CONF_BUILD_FOLDER)/rules: .conf.mk $(CONF_LINUX_SOURCES)/Kconfig .target + mkdir -p $(dir $@) + scripts/parse_kconfig/parse -v -v --env .conf.mk $(CONF_LINUX_SOURCES)/Kconfig $(dir $@) + .PHONY: evaluate evaluate: scripts/evaluate.py diff --git a/scripts/initialize.py b/scripts/initialize.py index 1847a04..c399d0d 100755 --- a/scripts/initialize.py +++ b/scripts/initialize.py @@ -16,29 +16,10 @@ def all(): utils.dirtycheck() except exceptions.DirtyRepository as e: print("Warning: " + str(e)) - parse_kconfig() gen_fixed() checkmeasure() database.database() # check if database is initialized -def parse_kconfig(): - "Execute parse_kconfig in linux_sources directory." - if os.path.isfile(sf(conf.symbol_map_file)) and \ - os.path.isfile(sf(conf.rules_file)) and \ - os.path.isfile(sf(conf.variable_count_file)): - print('Warning: parse_kconfig not executed. Files already exists.') - return - print('Executing parse_kconfig...') - wd = os.getcwd() - os.chdir(sf(conf.linux_sources)) - parse_kconfig_cmd = [sf(conf.parse_kconfig)] - parse_kconfig_cmd += ['Kconfig', sf(conf.build_folder)] - parse_kconfig_cmd += ['-v', '-v'] - utils.callsubprocess("parse_kconfig", parse_kconfig_cmd, - conf.parse_kconfig_output, env=utils.get_kernel_env()) - os.chdir(wd) - - def __gen_allconfig_fixed__(): wd = os.getcwd() os.chdir(sf(conf.linux_sources)) diff --git a/scripts/parse_kconfig/parse.c b/scripts/parse_kconfig/parse.c index 79c256a..5c27305 100644 --- a/scripts/parse_kconfig/parse.c +++ b/scripts/parse_kconfig/parse.c @@ -11,6 +11,7 @@ #include "output.h" #include "macros.h" #include "doutput.h" +#include int verbose_level; char *file, *folder; @@ -27,7 +28,12 @@ int main(int argc, char **argv) { for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "-v")) verbose_level++; - else if (file == NULL) + else if (!strcmp(argv[i], "--env")) { + if (++i < argc) + set_missing_env(argv[i]); + else + exit(1); + } else if (file == NULL) file = argv[i]; else if (folder == NULL) folder = argv[i]; @@ -50,7 +56,7 @@ int main(int argc, char **argv) { bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); - conf_parse(file); + conf_parse_path(file); //sym_clear_all_valid(); gsymlist = symlist_create(); @@ -87,6 +93,7 @@ void build_symlist() { symlist_closesym(gsymlist); } +/* TODO: Split to smaller functions with meaningful names */ void cpy_dep() { int i; struct symbol *sym;