]> rtime.felk.cvut.cz Git - linux-conf-perf.git/commitdiff
Move parse_kconfig invocation from .py to Makefile
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 17 Oct 2015 14:01:54 +0000 (16:01 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 17 Oct 2015 14:01:54 +0000 (16:01 +0200)
It's more understandable.

Makefile
scripts/initialize.py
scripts/parse_kconfig/parse.c

index 70e1a7828ac17a766e402fdd81dd734afc35a7a5..c5e6507ce2c8f980564ff259033951fdc64d2b08 100644 (file)
--- 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
index 1847a04174e136a66ef1e2c370dfc26ba2e23743..c399d0d57a62b6d4ed0bb0526cff4431eb51d91a 100755 (executable)
@@ -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))
index 79c256aba1622cbb9390892e0a1e84a6132a387f..5c27305d2cd9eaf1618007d99e4a8374921cf909 100644 (file)
@@ -11,6 +11,7 @@
 #include "output.h"
 #include "macros.h"
 #include "doutput.h"
+#include <kconfig/lcp_utils.h>
 
 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;