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