]> rtime.felk.cvut.cz Git - linux-conf-perf.git/blob - Makefile
Add makefile target psql
[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 psql
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 psql:
35         PGPASSWORD="$(CONF_DB_PASSWORD)" psql -d "$(CONF_DB_DATABASE)" -h "$(CONF_DB_HOST)" -p "$(CONF_DB_PORT)"
36
37 mbuildroot: buildroot/.config buildroot/system/skeleton/usr/bin/linux-conf-perf
38         $(MAKE) -C buildroot menuconfig
39
40 mlinux:
41         ARCH=$(CONF_KERNEL_ARCH) $(MAKE) -C $(CONF_LINUX_SOURCES) menuconfig
42
43 deflinux:
44         ARCH=$(CONF_KERNEL_ARCH) $(MAKE) -C $(CONF_LINUX_SOURCES) defconfig
45
46 dot_config: allconfig
47         cd $(CONF_LINUX_SOURCES) && \
48                 SRCARCH=$(CONF_KERNEL_ARCH) \
49                 ARCH=$(CONF_KERNEL_ARCH) \
50                 KERNELVERSION=$(CONF_KERNEL_ARCH) \
51                 $(CONF_ABSROOT)/scripts/allconfig/allconfig \
52                 Kconfig .config $(CONF_ABSROOT)/$(CONF_DOT_CONFIG)
53
54 init: initialize
55 initialize: all
56         scripts/initialize.py
57
58 initdb: initialize_database
59 initialize_database:
60         PGPASSWORD="$(CONF_DB_PASSWORD)" psql -d "$(CONF_DB_DATABASE)" -h "$(CONF_DB_HOST)" -p "$(CONF_DB_PORT)" -f scripts/databaseinit.sql
61
62 test: parse_kconfig
63         scripts/test.py
64
65 run: all
66         scripts/loop.py
67
68 evaluate:
69         scripts/evaluate.py
70
71 clean:
72         @$(MAKE) -C scripts/parse_kconfig clean
73         @$(MAKE) -C scripts/write_config clean
74         @$(MAKE) -C scripts/allconfig clean
75         @if [ -e scripts/picosat-959/makefile ]; then $(MAKE) -C scripts/picosat-959 clean; fi
76         $(RM) .conf.mk
77         $(RM) -r jobfiles
78
79 clean_measure:
80         $(RM) -r configurations
81         $(RM) -r output
82         $(RM) -r result
83         $(RM) $(CONF_DOT_CONFIG)
84
85 cleandb: clean_database
86 clean_database:
87         PGPASSWORD="$(CONF_DB_PASSWORD)" psql -d "$(CONF_DB_DATABASE)" -h "$(CONF_DB_HOST)" -p "$(CONF_DB_PORT)" -f scripts/databaseclean.sql
88
89 distclean: clean distclean_linux distclean_buildroot clean_measure
90
91 clean_linux:
92         @$(MAKE) -C $(CONF_LINUX_SOURCES) clean
93
94 distclean_linux:
95         @$(MAKE) -C $(CONF_LINUX_SOURCES) distclean
96
97 clean_buildroot:
98         @$(MAKE) -C buildroot clean
99
100 distclean_buildroot:
101         @$(MAKE) -C buildroot distclean
102
103 #######################################
104
105 .conf.mk: conf.py .target
106         scripts/confmk.py
107
108 .target:
109         $(error Please select target by writing it to .target file)
110
111 parse_kconfig:
112         @if [ `$(MAKE) -C scripts/parse_kconfig/ -q; echo $$?` != "0" ]; then \
113         $(MAKE) -C scripts/parse_kconfig/; fi
114
115 write_config:
116         @if [ `$(MAKE) -C scripts/write_config/ -q; echo $$?` != "0" ]; then \
117         $(MAKE) -C scripts/write_config/; fi
118
119 allconfig:
120         @if [ `$(MAKE) -C scripts/allconfig/ -q; echo $$?` != "0" ]; then \
121         $(MAKE) -C scripts/allconfig/; fi
122
123 picosat:
124         @if [ ! -e scripts/picosat-959/makefile ]; then \
125         cd scripts/picosat-959 && ./configure; fi
126         @if [ `$(MAKE) -C scripts/picosat-959 -q; echo $$?` != "0" ]; then \
127         $(MAKE) -C scripts/picosat-959; fi