]> rtime.felk.cvut.cz Git - linux-conf-perf.git/blob - Makefile
98af2c01a42ff2daee1c2d66edcf96e246a178a6
[linux-conf-perf.git] / Makefile
1 .PHONY: all help parse_kconfig write_config build run test clean clean_linux clean_buildroot mlinux mbuildroot deflinux distclean_linux distclean_buildroot distclean
2
3 -include .conf.mk
4
5 BENCHMARK_FILES := $(patsubst benchmark/%,scripts/buildroot/system/skeleton/usr/share/benchmark/%,$(shell find benchmark -type f))
6 BENCHMARK_FOLDERS := $(shell dirname $(BENCHMARK_FILES))
7
8 all: parse_kconfig write_config
9
10 help:
11         @echo "all         - Builds basic programs and prints message about next steps."
12         @echo "help        - Prints this text"
13         @echo "mbuildroot  - Calls 'make menuconfig' in buildroot folder. Use this for"
14         @echo "              buildroot configuration."
15         @echo "mlinux      - Calls 'make menuconfig' in linux folder. Use this for linux"
16         @echo "              configuration."
17         @echo "deflinux    - Executes 'make defconfig' in linux folder. This generates default"
18         @echo "              linux configuration for architecture specified in conf.py"
19         @echo "test        - Executes boot and benchmark test. You should use this before"
20         @echo "              target run. This target is for testing if initial kernel"
21         @echo "              configuration, buildroot configuration and benchmark are"
22         @echo "              configured right."
23         @echo "run         - Executes loop of kernel building, booting and benchmark execution."
24         @echo "evaluate    - Creating result statistics from generated data."
25         @echo
26         @echo "clean               - Cleans all generated files. Except those in"
27         @echo "                      linux and buildroot."
28         @echo "distclean           - Cleans all configurations and generated files."
29         @echo "                      Including linux and buildroot."
30         @echo "clean_linux         - Executes 'make clean' in linux folder."
31         @echo "distclean_linux     - Executes 'make distclean' in linux folder."
32         @echo "clean_buildroot     - Executes 'make clean' in buildroot folder."
33         @echo "distclean_buildroot - Executes 'make distclean' in buildroot folder."
34
35 mbuildroot: scripts/buildroot/.config scripts/buildroot/system/skeleton/usr/bin/linux-conf-perf $(BENCHMARK_FILES)
36         $(MAKE) -C scripts/buildroot menuconfig
37
38 mlinux:
39         ARCH=$(SRCARCH) $(MAKE) -C linux menuconfig
40
41 deflinux:
42         ARCH=$(SRCARCH) $(MAKE) -C linux defconfig
43
44 test: $(INITRAM)
45         @ #TODO
46
47 run: kconfig_parser write_config $(INITRAM)
48         scripts/main_loop.py
49
50 evaluate:
51         @ #TODO
52
53 clean:
54         @$(MAKE) -C scripts/parse_kconfig/ clean
55         @$(MAKE) -C scripts/write_config/ clean
56         $(RM) -r build
57         $(RM) -r scripts/buildroot/system/skeleton/usr/share/benchmark
58
59 distclean: clean distclean_linux distclean_buildroot
60         $(RM) .conf.mk
61
62 clean_linux:
63         @$(MAKE) -C linux clean
64
65 distclean_linux:
66         @$(MAKE) -C linux distclean
67
68 clean_buildroot:
69         @$(MAKE) -C scripts/buildroot clean
70
71 distclean_buildroot:
72         @$(MAKE) -C scripts/buildroot distclean
73
74 #######################################
75
76 .conf.mk: conf.py
77         scripts/confmk.py
78
79 parse_kconfig:
80         @$(MAKE) -C scripts/parse_kconfig/
81
82 write_config:
83         @$(MAKE) -C scripts/write_config/
84
85 %:
86         mkdir -p $@
87
88 $(BUILDROOT_INITRAM): scripts/buildroot/.config
89         @$(MAKE) -C scripts/buildroot
90
91 $(INITRAM): $(shell dirname $(INITRAM))
92 $(INITRAM): $(BUILDROOT_INITRAM) $${@D}
93         mv $^ $@
94
95 scripts/buildroot/.config:
96         cp $(BUILDROOT_DEF_CONFIG) $@
97
98 scripts/buildroot/system/skeleton/usr/bin/linux-conf-perf:
99         cp $(BUILDROOT_INITSCRIPT) $@
100         cat $(BUILDROOT_INITTAB_DIRECTIVE) >> scripts/buildroot/system/skeleton/etc/inittab
101
102 $(BENCHMARK_FILES): $(BENCHMARK_FOLDERS)
103 scripts/buildroot/system/skeleton/usr/share/benchmark/%: benchmark/%
104         cp $< $@