]> rtime.felk.cvut.cz Git - linux-conf-perf.git/blob - Makefile
More meaningful error message
[linux-conf-perf.git] / Makefile
1 HELP=""
2 -include .conf.mk
3
4 HELP+="all         - Builds basic programs and prints message about next steps.\n"
5 .PHONY: all
6 all: parse_kconfig write_config allconfig picosat initram_cyclictest
7
8 .PHONY: help
9 help:
10         @echo " help        - Prints this text"
11         @echo -e $(HELP)
12
13 HELP+="psql        - Launch PostgreSQL interactive terminal.\n"
14 .PHONY: psql
15 psql:
16         PGPASSWORD="$(CONF_DB_PASSWORD)" psql -d "$(CONF_DB_DATABASE)" -h "$(CONF_DB_HOST)" -p "$(CONF_DB_PORT)"
17
18 .PHONY: mbuildroot
19 mbuildroot:
20         $(MAKE) -C tests/cyclictest/root/ menuconfig
21
22 HELP+="mlinux      - Calls 'make menuconfig' in Linux folder. Use this for Linux\n"
23 HELP+="              configuration.\n"
24 .PHONY: mlinux
25 mlinux:
26         ARCH=$(CONF_KERNEL_ARCH) $(MAKE) -C $(CONF_LINUX_SOURCES) menuconfig
27
28 HELP+="deflinux    - Executes 'make menuconfig' in linux folder. This generates default\n"
29 HELP+="              linux configuration.\n"
30 .PHONY: deflinux
31 deflinux:
32         ARCH=$(CONF_KERNEL_ARCH) $(MAKE) -C $(CONF_LINUX_SOURCES) defconfig
33
34 HELP+="dot_config  - Generate dot_config file. This file is based on default Linux\n"
35 HELP+="              configuration.\n"
36 dot_config: allconfig
37         cd $(CONF_LINUX_SOURCES) && \
38                 SRCARCH=$(CONF_KERNEL_ARCH) \
39                 ARCH=$(CONF_KERNEL_ARCH) \
40                 KERNELVERSION=$(CONF_KERNEL_ARCH) \
41                 $(CONF_ABSROOT)/scripts/allconfig/allconfig \
42                 Kconfig .config $(CONF_ABSROOT)/$(CONF_DOT_CONFIG)
43
44 HELP+="initialize  - Executes only initialization.\n"
45 .PHONY: initialize init
46 init: initialize
47 initialize: all
48         scripts/initialize.py
49
50 HELP+="initdb      - Initialize database.\n"
51 .PHONY: initdb initialize_database
52 initdb: initialize_database
53 initialize_database:
54         PGPASSWORD="$(CONF_DB_PASSWORD)" psql -d "$(CONF_DB_DATABASE)" -h "$(CONF_DB_HOST)" -p "$(CONF_DB_PORT)" -f scripts/databaseinit.sql
55
56 HELP+="test        - Executes boot and benchmark test. You should use this before\n"
57 HELP+="              target run. This target is for testing if initial kernel\n"
58 HELP+="              configuration, buildroot configuration and benchmark are\n"
59 HELP+="              configured right.\n"
60 .PHONY: test
61 test: parse_kconfig initram_cyclictest
62         scripts/test.py
63
64 HELP+="run         - Executes loop of kernel building, booting and benchmark execution.\n"
65 .PHONY: run
66 run: all
67         scripts/loop.py
68
69 .PHONY: evaluate
70 evaluate:
71         scripts/evaluate.py
72
73 HELP+="\n"
74
75 HELP+="clean           - Cleans all generated files. Except those in\n"
76 HELP+="                  linux and buildroot.\n"
77 .PHONY: clean
78 clean:
79         @$(MAKE) -C scripts/parse_kconfig clean
80         @$(MAKE) -C scripts/write_config clean
81         @$(MAKE) -C scripts/allconfig clean
82         @if [ -e scripts/picosat-959/makefile ]; then $(MAKE) -C scripts/picosat-959 clean; fi
83         $(RM) .conf.mk
84         $(RM) -r jobfiles
85
86 HELP+="clean_measure   - Removes working files used while measuring. After this,\n"
87 HELP+="                  initializations has to be executed once again.\n"
88 .PHONY: clean_measure
89 clean_measure:
90         $(RM) -r configurations
91         $(RM) -r output
92         $(RM) -r result
93         $(RM) $(CONF_DOT_CONFIG)
94
95 HELP+="clean_database  - Drop all tables in database.\n"
96 .PHONY: cleandb clean_database
97 cleandb: clean_database
98 clean_database:
99         PGPASSWORD="$(CONF_DB_PASSWORD)" psql -d "$(CONF_DB_DATABASE)" -h "$(CONF_DB_HOST)" -p "$(CONF_DB_PORT)" -f scripts/databaseclean.sql
100
101 HELP+="distclean       - Cleans all configurations and generated files.\n"
102 HELP+="                  Including linux and buildroot.\n"
103 .PHONY: distclean
104 distclean: clean distclean_linux distclean_buildroot clean_measure
105
106 HELP+="clean_linux     - Executes 'make clean' in linux folder.\n"
107 .PHONY: clean_linux
108 clean_linux:
109         @$(MAKE) -C $(CONF_LINUX_SOURCES) clean
110
111 HELP+="distclean_linux - Executes 'make distclean' in linux folder.\n"
112 .PHONY: distclean_linux
113 distclean_linux:
114         @$(MAKE) -C $(CONF_LINUX_SOURCES) distclean
115
116 .PHONY: clean_buildroot
117 clean_buildroot:
118         @$(MAKE) -C tests/cyclictest/root/ clean
119
120 .PHONY: distclean_buildroot
121 distclean_buildroot:
122         @$(MAKE) -C tests/cyclictest/root/ distclean
123
124 #######################################
125
126 .conf.mk: conf.py .target
127         scripts/confmk.py
128
129 .target:
130         $(error Please select target by writing it to .target file)
131
132 .PHONY: parse_kconfig
133 parse_kconfig:
134         @if [ `$(MAKE) -C scripts/parse_kconfig/ -q; echo $$?` != "0" ]; then \
135         $(MAKE) -C scripts/parse_kconfig/; fi
136
137 .PHONY: write_config
138 write_config:
139         @if [ `$(MAKE) -C scripts/write_config/ -q; echo $$?` != "0" ]; then \
140         $(MAKE) -C scripts/write_config/; fi
141
142 .PHONY:allconfig
143 allconfig:
144         @if [ `$(MAKE) -C scripts/allconfig/ -q; echo $$?` != "0" ]; then \
145         $(MAKE) -C scripts/allconfig/; fi
146
147 .PHONY: picosat
148 picosat:
149         @if [ ! -e scripts/picosat-959/makefile ]; then \
150         cd scripts/picosat-959 && ./configure; fi
151         @if [ `$(MAKE) -C scripts/picosat-959 -q; echo $$?` != "0" ]; then \
152         $(MAKE) -C scripts/picosat-959; fi
153
154 .PHONY: initram_cyclictest
155 initram_cyclictest:
156         @if [ `$(MAKE) -C tests/cyclictest/root/ -q; echo $$?` != "0" ]; then \
157         $(MAKE) -C scripts/cyclictest/root/; fi