]> rtime.felk.cvut.cz Git - linux-conf-perf.git/blobdiff - Makefile
Allow importing lcp_django from other python scripts
[linux-conf-perf.git] / Makefile
index 439dc7790635c311425f371d9bda80e8eaac2703..76babfb829deeb2ed3e4061f994ee661a4f87204 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,17 @@
 HELP=""
 include .conf.mk
-include .stamp/empty
+include .stamp/empty # This creates the .stamp directory
+
+HELPER_PROGRAMS = scripts/parse_kconfig/parse          \
+                 scripts/write_config/write_config     \
+                 scripts/allconfig/allconfig           \
+                 scripts/picosat-959/picosat
 
 HELP+="all         - Builds basic programs and prints message about next steps.\n"
 .PHONY: all
-all: parse_kconfig write_config allconfig picosat .stamp/initram_cyclictest
+all:  $(HELPER_PROGRAMS) .stamp/initram_cyclictest
+       mkdir -p $(CONF_LOG_FOLDER)
+       mkdir -p $(CONF_BUILD_FOLDER)
 
 .PHONY: help
 help:
@@ -14,7 +21,7 @@ help:
 HELP+="psql        - Launch PostgreSQL interactive terminal.\n"
 .PHONY: psql
 psql:
-       PGPASSWORD="$(CONF_DB_PASSWORD)" psql -d "$(CONF_DB_DATABASE)" -h "$(CONF_DB_HOST)" -p "$(CONF_DB_PORT)"
+       psql -d "$(CONF_DB_DATABASE)"
 
 .PHONY: mbuildroot
 mbuildroot:
@@ -26,7 +33,7 @@ HELP+="              configuration.\n"
 mlinux:
        ARCH=$(CONF_KERNEL_ARCH) $(MAKE) -C $(CONF_LINUX_SOURCES) menuconfig
 
-HELP+="deflinux    - Executes 'make menuconfig' in linux folder. This generates default\n"
+HELP+="deflinux    - Executes 'make defconfig' in linux folder. This generates default\n"
 HELP+="              linux configuration.\n"
 .PHONY: deflinux
 deflinux:
@@ -34,13 +41,8 @@ deflinux:
 
 HELP+="dot_config  - Generate dot_config file. This file is based on default Linux\n"
 HELP+="              configuration.\n"
-dot_config: allconfig
-       cd $(CONF_LINUX_SOURCES) && \
-               SRCARCH=$(CONF_KERNEL_ARCH) \
-               ARCH=$(CONF_KERNEL_ARCH) \
-               KERNELVERSION=$(CONF_KERNEL_ARCH) \
-               $(CONF_ABSROOT)/scripts/allconfig/allconfig \
-               Kconfig .config $(CONF_ABSROOT)/$(CONF_DOT_CONFIG)
+$(CONF_DOT_CONFIG): .conf.mk scripts/allconfig/allconfig $(CONF_LINUX_BUILD_FOLDER)/.config
+       scripts/allconfig/allconfig --env .conf.mk $(CONF_LINUX_SOURCES)/Kconfig $(CONF_LINUX_BUILD_FOLDER)/.config $@
 
 HELP+="initialize  - Executes only initialization.\n"
 .PHONY: initialize init
@@ -48,25 +50,37 @@ init: initialize
 initialize: all
        scripts/initialize.py
 
-HELP+="initdb      - Initialize database.\n"
-.PHONY: initdb initialize_database
+HELP+="dbmigrate   - Migrate database.\n"
+.PHONY: initdb initialize_database dbmigrate
 initdb: initialize_database
-initialize_database:
-       PGPASSWORD="$(CONF_DB_PASSWORD)" psql -d "$(CONF_DB_DATABASE)" -h "$(CONF_DB_HOST)" -p "$(CONF_DB_PORT)" -f scripts/databaseinit.sql
+initialize_database: dbmigrate
+dbmigrate:
+       ./scripts/database/manage.py makemigrations
+       ./scripts/database/manage.py migrate
 
 HELP+="test        - Executes boot and benchmark test. You should use this before\n"
 HELP+="              target run. This target is for testing if initial kernel\n"
 HELP+="              configuration, buildroot configuration and benchmark are\n"
 HELP+="              configured right.\n"
 .PHONY: test
-test: parse_kconfig .stamp/initram_cyclictest
+test: scripts/parse_kconfig/parse .stamp/initram_cyclictest
        scripts/test.py
 
 HELP+="run         - Executes loop of kernel building, booting and benchmark execution.\n"
 .PHONY: run
-run: all
+run: all $(CONF_BUILD_FOLDER)/rules $(CONF_BUILD_FOLDER)/fixed
+       ln -sf ../dot_measure $(CONF_BUILD_FOLDER)
        scripts/loop.py
 
+$(CONF_BUILD_FOLDER)/rules $(CONF_BUILD_FOLDER)/symbol_map: .conf.mk $(CONF_LINUX_SOURCES)/Kconfig
+       scripts/parse_kconfig/parse -v --env .conf.mk $(CONF_LINUX_SOURCES)/Kconfig $(dir $@)
+
+$(CONF_BUILD_FOLDER)/allconfig: .conf.mk $(CONF_LINUX_SOURCES)/Kconfig $(CONF_LINUX_BUILD_FOLDER)/.config
+       scripts/allconfig/allconfig --env .conf.mk $(CONF_LINUX_SOURCES)/Kconfig $(CONF_LINUX_BUILD_FOLDER)/.config $@
+
+$(CONF_BUILD_FOLDER)/fixed $(CONF_BUILD_FOLDER)/measure: .conf.mk $(CONF_BUILD_FOLDER)/allconfig dot_measure
+       scripts/gen_fixed.py $(CONF_BUILD_FOLDER)/allconfig dot_measure
+
 .PHONY: evaluate
 evaluate:
        scripts/evaluate.py
@@ -93,11 +107,11 @@ clean_measure:
        $(RM) -r result
        $(RM) $(CONF_DOT_CONFIG)
 
-HELP+="clean_database  - Drop all tables in database.\n"
+HELP+="clean_database  - Drop all entries in database.\n"
 .PHONY: cleandb clean_database
 cleandb: clean_database
 clean_database:
-       PGPASSWORD="$(CONF_DB_PASSWORD)" psql -d "$(CONF_DB_DATABASE)" -h "$(CONF_DB_HOST)" -p "$(CONF_DB_PORT)" -f scripts/databaseclean.sql
+       ./scripts/database/manage.py flush
 
 HELP+="distclean       - Cleans all configurations and generated files.\n"
 HELP+="                  Including linux and buildroot.\n"
@@ -124,33 +138,19 @@ distclean_buildroot:
 
 #######################################
 
-.conf.mk: conf.py .target
+.conf.mk: conf.py .target targets/$(shell cat .target)/conf.py
        scripts/confmk.py
 
 .target:
        $(error Please select target by writing it to .target file)
 
-.PHONY: parse_kconfig
-parse_kconfig:
-       @if ! $(MAKE) -C scripts/parse_kconfig/ -q; then \
-       $(MAKE) -C scripts/parse_kconfig/; fi
-
-.PHONY: write_config
-write_config:
-       @if ! $(MAKE) -C scripts/write_config/ -q; then \
-       $(MAKE) -C scripts/write_config/; fi
-
-.PHONY:allconfig
-allconfig:
-       @if ! $(MAKE) -C scripts/allconfig/ -q; then \
-       $(MAKE) -C scripts/allconfig/; fi
-
-.PHONY: picosat
-picosat:
-       @if [ ! -e scripts/picosat-959/makefile ]; then \
-       cd scripts/picosat-959 && ./configure; fi
-       @if ! $(MAKE) -C scripts/picosat-959 -q; then \
-       $(MAKE) -C scripts/picosat-959; fi
+$(HELPER_PROGRAMS):
+       $(MAKE) -C $(dir $@)
+
+scripts/picosat-959/makefile:
+       cd $(dir $@) && ./configure
+
+scripts/picosat-959/picosat: scripts/picosat-959/makefile
 
 .stamp/initram_cyclictest: .conf.mk
        $(MAKE) -C tests/cyclictest/root