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