]> rtime.felk.cvut.cz Git - linux-conf-perf.git/blob - Makefile
Allow importing lcp_django from other python scripts
[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         psql -d "$(CONF_DB_DATABASE)"
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+="dbmigrate   - Migrate database.\n"
54 .PHONY: initdb initialize_database dbmigrate
55 initdb: initialize_database
56 initialize_database: dbmigrate
57 dbmigrate:
58         ./scripts/database/manage.py makemigrations
59         ./scripts/database/manage.py migrate
60
61 HELP+="test        - Executes boot and benchmark test. You should use this before\n"
62 HELP+="              target run. This target is for testing if initial kernel\n"
63 HELP+="              configuration, buildroot configuration and benchmark are\n"
64 HELP+="              configured right.\n"
65 .PHONY: test
66 test: scripts/parse_kconfig/parse .stamp/initram_cyclictest
67         scripts/test.py
68
69 HELP+="run         - Executes loop of kernel building, booting and benchmark execution.\n"
70 .PHONY: run
71 run: all $(CONF_BUILD_FOLDER)/rules $(CONF_BUILD_FOLDER)/fixed
72         ln -sf ../dot_measure $(CONF_BUILD_FOLDER)
73         scripts/loop.py
74
75 $(CONF_BUILD_FOLDER)/rules $(CONF_BUILD_FOLDER)/symbol_map: .conf.mk $(CONF_LINUX_SOURCES)/Kconfig
76         scripts/parse_kconfig/parse -v --env .conf.mk $(CONF_LINUX_SOURCES)/Kconfig $(dir $@)
77
78 $(CONF_BUILD_FOLDER)/allconfig: .conf.mk $(CONF_LINUX_SOURCES)/Kconfig $(CONF_LINUX_BUILD_FOLDER)/.config
79         scripts/allconfig/allconfig --env .conf.mk $(CONF_LINUX_SOURCES)/Kconfig $(CONF_LINUX_BUILD_FOLDER)/.config $@
80
81 $(CONF_BUILD_FOLDER)/fixed $(CONF_BUILD_FOLDER)/measure: .conf.mk $(CONF_BUILD_FOLDER)/allconfig dot_measure
82         scripts/gen_fixed.py $(CONF_BUILD_FOLDER)/allconfig dot_measure
83
84 .PHONY: evaluate
85 evaluate:
86         scripts/evaluate.py
87
88 HELP+="\n"
89
90 HELP+="clean           - Cleans all generated files. Except those in\n"
91 HELP+="                  linux and buildroot.\n"
92 .PHONY: clean
93 clean:
94         @$(MAKE) -C scripts/parse_kconfig clean
95         @$(MAKE) -C scripts/write_config clean
96         @$(MAKE) -C scripts/allconfig clean
97         @if [ -e scripts/picosat-959/makefile ]; then $(MAKE) -C scripts/picosat-959 clean; fi
98         $(RM) .conf.mk
99         $(RM) -r jobfiles
100
101 HELP+="clean_measure   - Removes working files used while measuring. After this,\n"
102 HELP+="                  initializations has to be executed once again.\n"
103 .PHONY: clean_measure
104 clean_measure:
105         $(RM) -r configurations
106         $(RM) -r output
107         $(RM) -r result
108         $(RM) $(CONF_DOT_CONFIG)
109
110 HELP+="clean_database  - Drop all entries in database.\n"
111 .PHONY: cleandb clean_database
112 cleandb: clean_database
113 clean_database:
114         ./scripts/database/manage.py flush
115
116 HELP+="distclean       - Cleans all configurations and generated files.\n"
117 HELP+="                  Including linux and buildroot.\n"
118 .PHONY: distclean
119 distclean: clean distclean_linux distclean_buildroot clean_measure
120
121 HELP+="clean_linux     - Executes 'make clean' in linux folder.\n"
122 .PHONY: clean_linux
123 clean_linux:
124         @$(MAKE) -C $(CONF_LINUX_SOURCES) clean
125
126 HELP+="distclean_linux - Executes 'make distclean' in linux folder.\n"
127 .PHONY: distclean_linux
128 distclean_linux:
129         @$(MAKE) -C $(CONF_LINUX_SOURCES) distclean
130
131 .PHONY: clean_buildroot
132 clean_buildroot:
133         @$(MAKE) -C tests/cyclictest/root/ clean
134
135 .PHONY: distclean_buildroot
136 distclean_buildroot:
137         @$(MAKE) -C tests/cyclictest/root/ distclean
138
139 #######################################
140
141 .conf.mk: conf.py .target targets/$(shell cat .target)/conf.py
142         scripts/confmk.py
143
144 .target:
145         $(error Please select target by writing it to .target file)
146
147 $(HELPER_PROGRAMS):
148         $(MAKE) -C $(dir $@)
149
150 scripts/picosat-959/makefile:
151         cd $(dir $@) && ./configure
152
153 scripts/picosat-959/picosat: scripts/picosat-959/makefile
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 $@