]> rtime.felk.cvut.cz Git - linux-conf-perf.git/blob - Makefile
Add NBSCRIPT config
[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         scripts/test.py
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         $(RM) $(INITRAM)
59         $(RM) $(NBSCRIPT)
60
61 distclean: clean distclean_linux distclean_buildroot
62         $(RM) .conf.mk
63
64 clean_linux:
65         @$(MAKE) -C linux clean
66
67 distclean_linux:
68         @$(MAKE) -C linux distclean
69
70 clean_buildroot:
71         @$(MAKE) -C scripts/buildroot clean
72
73 distclean_buildroot:
74         @$(MAKE) -C scripts/buildroot distclean
75
76 #######################################
77
78 .conf.mk: conf.py
79         scripts/confmk.py
80
81 parse_kconfig:
82         @$(MAKE) -C scripts/parse_kconfig/
83
84 write_config:
85         @$(MAKE) -C scripts/write_config/
86
87 scripts/buildroot/system/skeleton/usr/share/%:
88         mkdir -p $@
89
90 build:
91         mkdir -p $@
92
93 $(BUILDROOT_INITRAM): scripts/buildroot/.config
94         @$(MAKE) -C scripts/buildroot
95
96 $(INITRAM): build
97 $(INITRAM): $(BUILDROOT_INITRAM)
98         mv $< $@
99
100 scripts/buildroot/.config:
101         cp $(BUILDROOT_DEF_CONFIG) $@
102
103 scripts/buildroot/system/skeleton/usr/bin/linux-conf-perf:
104         cp $(BUILDROOT_INITSCRIPT) $@
105         cat $(BUILDROOT_INITTAB_DIRECTIVE) >> scripts/buildroot/system/skeleton/etc/inittab
106
107 $(BENCHMARK_FILES): $(BENCHMARK_FOLDERS)
108 scripts/buildroot/system/skeleton/usr/share/benchmark/%: benchmark/%
109         cp $< $@