]> rtime.felk.cvut.cz Git - linux-conf-perf.git/blob - Makefile
Add dot_config target to root Makefile
[linux-conf-perf.git] / Makefile
1 .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
2
3 -include .conf.mk
4
5 all: parse_kconfig write_config allconfig picosat
6
7 help:
8         @echo "all         - Builds basic programs and prints message about next steps."
9         @echo "help        - Prints this text"
10         @echo "mbuildroot  - Calls 'make menuconfig' in buildroot folder. Use this for"
11         @echo "              buildroot configuration."
12         @echo "mlinux      - Calls 'make menuconfig' in linux folder. Use this for linux"
13         @echo "              configuration."
14         @echo "deflinux    - Executes 'make defconfig' in linux folder. This generates default"
15         @echo "              linux configuration for architecture specified in conf.py"
16         @echo "initialize  - Executes only initialization. Depending on configuration this"
17         @echo "              can take various amount of time."
18         @echo "test        - Executes boot and benchmark test. You should use this before"
19         @echo "              target run. This target is for testing if initial kernel"
20         @echo "              configuration, buildroot configuration and benchmark are"
21         @echo "              configured right."
22         @echo "run         - Executes loop of kernel building, booting and benchmark execution."
23         @echo "evaluate    - Creating result statistics from generated data."
24         @echo
25         @echo "clean               - Cleans all generated files. Except those in"
26         @echo "                      linux and buildroot."
27         @echo "distclean           - Cleans all configurations and generated files."
28         @echo "                      Including linux and buildroot."
29         @echo "clean_linux         - Executes 'make clean' in linux folder."
30         @echo "distclean_linux     - Executes 'make distclean' in linux folder."
31         @echo "clean_buildroot     - Executes 'make clean' in buildroot folder."
32         @echo "distclean_buildroot - Executes 'make distclean' in buildroot folder."
33
34 mbuildroot: buildroot/.config buildroot/system/skeleton/usr/bin/linux-conf-perf
35         $(MAKE) -C buildroot menuconfig
36
37 mlinux:
38         ARCH=$(CONF_KERNEL_ARCH) $(MAKE) -C linux menuconfig
39
40 deflinux:
41         ARCH=$(CONF_KERNEL_ARCH) $(MAKE) -C linux defconfig
42
43 dot_config: allconfig
44         cd linux && SRCARCH=$(CONF_KERNEL_ARCH) ARCH=$(CONF_KERNEL_ARCH) KERNELVERSION=$(CONF_KERNEL_ARCH) \
45                 ../scripts/allconfig/allconfig Kconfig .config ../$(CONF_DOT_CONFIG)
46
47 init: initialize
48 initialize: parse_kconfig picosat
49         scripts/initialize.py
50
51 initdb: initialize_database
52 initialize_database:
53         echo "$(CONF_DB_HOST):$(CONF_DB_PORT):$(CONF_DB_DATABASE):$(CONF_DB_USER):$(CONF_DB_PASSWORD)" > .pgpass
54         psql -d "$(CONF_DB_DATABASE)" -h "$(CONF_DB_HOST)" -p "$(CONF_DB_PORT)" -f scripts/databaseinit.sql
55         $(RM) .pgpass
56
57 test: parse_kconfig
58         scripts/test.py
59
60 run: parse_kconfig write_config picosat
61         scripts/loop.py
62
63 evaluate:
64         scripts/evaluate.py
65
66 clean:
67         @$(MAKE) -C scripts/parse_kconfig clean
68         @$(MAKE) -C scripts/write_config clean
69         @$(MAKE) -C scripts/allconfig clean
70         @if [ -e scripts/picosat-959/makefile ]; then $(MAKE) -C scripts/picosat-959 clean; fi
71         $(RM) .conf.mk
72         $(RM) -r jobfiles
73
74 clean_measure: cleandb
75         $(RM) -r configurations
76         $(RM) -r output
77         $(RM) -r result
78
79 cleandb: clean_database
80 clean_database:
81         echo "$(CONF_DB_HOST):$(CONF_DB_PORT):$(CONF_DB_DATABASE):$(CONF_DB_USER):$(CONF_DB_PASSWORD)" > .pgpass
82         psql -d "$(CONF_DB_DATABASE)" -h "$(CONF_DB_HOST)" -p "$(CONF_DB_PORT)" -f scripts/databaseclean.sql
83         rm -f .pgpass
84
85 distclean: clean distclean_linux distclean_buildroot
86         $(RM) .conf.mk
87
88 clean_linux:
89         @$(MAKE) -C linux clean
90
91 distclean_linux:
92         @$(MAKE) -C linux distclean
93
94 clean_buildroot:
95         @$(MAKE) -C buildroot clean
96
97 distclean_buildroot:
98         @$(MAKE) -C buildroot distclean
99
100 #######################################
101
102 .conf.mk: conf.py
103         scripts/confmk.py
104
105 parse_kconfig:
106         @$(MAKE) -C scripts/parse_kconfig/
107
108 write_config:
109         @$(MAKE) -C scripts/write_config/
110
111 allconfig:
112         @$(MAKE) -C scripts/allconfig/
113
114 buildroot/.config:
115         cp $(CONF_BUILDROOT_DEF_CONFIG) $@
116
117 buildroot/system/skeleton/usr/bin/linux-conf-perf:
118         cp $(CONF_BUILDROOT_INITSCRIPT) $@
119         cat $(CONF_BUILDROOT_INITTAB_DIRECTIVE) >> buildroot/system/skeleton/etc/inittab
120
121 picosat: scripts/picosat-959/picosat
122 scripts/picosat-959/picosat:
123         cd scripts/picosat-959 && ./configure
124         $(MAKE) -C scripts/picosat-959