]> rtime.felk.cvut.cz Git - linux-conf-perf.git/blobdiff - Makefile
Fix parse_kconfig symbol default
[linux-conf-perf.git] / Makefile
index 5e9982684568033c80046bbaf85ec99f688fbecc..35d85a32168460c702c6a7f0fce335263b6d74c9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
-.PHONY: all help parse_kconfig write_config build run test clean clean_linux clean_buildroot mlinux mbuildroot deflinux distclean_linux distclean_buildroot distclean picosat init initialize permute
+.PHONY: all help parse_kconfig write_config build run test clean clean_db clean_database clean_measure clean_linux clean_buildroot mlinux mbuildroot deflinux distclean_linux distclean_buildroot distclean picosat init initialize initialize_database initdb psql
 
 -include .conf.mk
 
-all: parse_kconfig write_config permute picosat
+all: parse_kconfig write_config allconfig picosat
 
 help:
        @echo "all         - Builds basic programs and prints message about next steps."
@@ -31,26 +31,38 @@ help:
        @echo "clean_buildroot     - Executes 'make clean' in buildroot folder."
        @echo "distclean_buildroot - Executes 'make distclean' in buildroot folder."
 
+psql:
+       PGPASSWORD="$(CONF_DB_PASSWORD)" psql -d "$(CONF_DB_DATABASE)" -h "$(CONF_DB_HOST)" -p "$(CONF_DB_PORT)"
+
 mbuildroot: buildroot/.config buildroot/system/skeleton/usr/bin/linux-conf-perf
        $(MAKE) -C buildroot menuconfig
 
 mlinux:
-       ARCH=$(ARCH) $(MAKE) -C linux menuconfig
+       ARCH=$(CONF_KERNEL_ARCH) $(MAKE) -C $(CONF_LINUX_SOURCES) menuconfig
 
 deflinux:
-       ARCH=$(ARCH) $(MAKE) -C linux defconfig
+       ARCH=$(CONF_KERNEL_ARCH) $(MAKE) -C $(CONF_LINUX_SOURCES) defconfig
 
-mpermute: permute
-       cd linux && SRCARCH=$(ARCH) ARCH=$(ARCH) KERNELVERSION=$(ARCH) ../scripts/permute/permute Kconfig
+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)
 
 init: initialize
-initialize: parse_kconfig picosat
+initialize: all
        scripts/initialize.py
 
+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
+
 test: parse_kconfig
        scripts/test.py
 
-run: parse_kconfig write_config picosat
+run: all
        scripts/loop.py
 
 evaluate:
@@ -59,48 +71,57 @@ evaluate:
 clean:
        @$(MAKE) -C scripts/parse_kconfig clean
        @$(MAKE) -C scripts/write_config clean
+       @$(MAKE) -C scripts/allconfig clean
        @if [ -e scripts/picosat-959/makefile ]; then $(MAKE) -C scripts/picosat-959 clean; fi
        $(RM) .conf.mk
        $(RM) -r jobfiles
-       $(RM) $(NBSCRIPT)
 
-distclean: clean distclean_linux distclean_buildroot
-       $(RM) .conf.mk
+clean_measure:
+       $(RM) -r configurations
+       $(RM) -r output
+       $(RM) -r result
+       $(RM) $(CONF_DOT_CONFIG)
+
+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
+
+distclean: clean distclean_linux distclean_buildroot clean_measure
 
 clean_linux:
-       @$(MAKE) -C linux clean
+       @$(MAKE) -C $(CONF_LINUX_SOURCES) clean
 
 distclean_linux:
-       @$(MAKE) -C linux distclean
+       @$(MAKE) -C $(CONF_LINUX_SOURCES) distclean
 
 clean_buildroot:
-       @$(MAKE) -C scripts/buildroot clean
+       @$(MAKE) -C buildroot clean
 
 distclean_buildroot:
-       @$(MAKE) -C scripts/buildroot distclean
+       @$(MAKE) -C buildroot distclean
 
 #######################################
 
-.conf.mk: conf.py
+.conf.mk: conf.py .target
        scripts/confmk.py
 
+.target:
+       $(error Please select target by writing it to .target file)
+
 parse_kconfig:
-       @$(MAKE) -C scripts/parse_kconfig/
+       @if [ `$(MAKE) -C scripts/parse_kconfig/ -q; echo $$?` != "0" ]; then \
+       $(MAKE) -C scripts/parse_kconfig/; fi
 
 write_config:
-       @$(MAKE) -C scripts/write_config/
-
-permute:
-       @$(MAKE) -C scripts/permute/
-
-buildroot/.config:
-       cp $(BUILDROOT_DEF_CONFIG) $@
-
-buildroot/system/skeleton/usr/bin/linux-conf-perf:
-       cp $(BUILDROOT_INITSCRIPT) $@
-       cat $(BUILDROOT_INITTAB_DIRECTIVE) >> buildroot/system/skeleton/etc/inittab
-
-picosat: scripts/picosat-959/picosat
-scripts/picosat-959/picosat:
-       cd scripts/picosat-959 && ./configure
-       $(MAKE) -C scripts/picosat-959
+       @if [ `$(MAKE) -C scripts/write_config/ -q; echo $$?` != "0" ]; then \
+       $(MAKE) -C scripts/write_config/; fi
+
+allconfig:
+       @if [ `$(MAKE) -C scripts/allconfig/ -q; echo $$?` != "0" ]; then \
+       $(MAKE) -C scripts/allconfig/; fi
+
+picosat:
+       @if [ ! -e scripts/picosat-959/makefile ]; then \
+       cd scripts/picosat-959 && ./configure; fi
+       @if [ `$(MAKE) -C scripts/picosat-959 -q; echo $$?` != "0" ]; then \
+       $(MAKE) -C scripts/picosat-959; fi