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