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