aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: c23f7b69ec3d7608122f1b4c247b5a9837b4ca83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
HELP=""
-include .conf.mk

HELP+="all         - Builds basic programs and prints message about next steps.\n"
.PHONY: all
all: parse_kconfig write_config allconfig picosat initram_cyclictest

.PHONY: help
help:
	@echo " help        - Prints this text"
	@echo -e $(HELP)

HELP+="psql        - Launch PostgreSQL interactive terminal.\n"
.PHONY: psql
psql:
	PGPASSWORD="$(CONF_DB_PASSWORD)" psql -d "$(CONF_DB_DATABASE)" -h "$(CONF_DB_HOST)" -p "$(CONF_DB_PORT)"

.PHONY: mbuildroot
mbuildroot:
	$(MAKE) -C tests/cyclictest/root/ menuconfig

HELP+="mlinux      - Calls 'make menuconfig' in Linux folder. Use this for Linux\n"
HELP+="              configuration.\n"
.PHONY: mlinux
mlinux:
	ARCH=$(CONF_KERNEL_ARCH) $(MAKE) -C $(CONF_LINUX_SOURCES) menuconfig

HELP+="deflinux    - Executes 'make menuconfig' in linux folder. This generates default\n"
HELP+="              linux configuration.\n"
.PHONY: deflinux
deflinux:
	ARCH=$(CONF_KERNEL_ARCH) $(MAKE) -C $(CONF_LINUX_SOURCES) defconfig

HELP+="dot_config  - Generate dot_config file. This file is based on default Linux\n"
HELP+="              configuration.\n"
dot_config: allconfig
	cd $(CONF_LINUX_SOURCES) && \
		SRCARCH=$(CONF_KERNEL_ARCH) \
		ARCH=$(CONF_KERNEL_ARCH) \
		KERNELVERSION=$(CONF_KERNEL_ARCH) \
		$(CONF_ABSROOT)/scripts/allconfig/allconfig \
		Kconfig .config $(CONF_ABSROOT)/$(CONF_DOT_CONFIG)

HELP+="initialize  - Executes only initialization.\n"
.PHONY: initialize init
init: initialize
initialize: all
	scripts/initialize.py

HELP+="initdb      - Initialize database.\n"
.PHONY: initdb initialize_database
initdb: initialize_database
initialize_database:
	PGPASSWORD="$(CONF_DB_PASSWORD)" psql -d "$(CONF_DB_DATABASE)" -h "$(CONF_DB_HOST)" -p "$(CONF_DB_PORT)" -f scripts/databaseinit.sql

HELP+="test        - Executes boot and benchmark test. You should use this before\n"
HELP+="              target run. This target is for testing if initial kernel\n"
HELP+="              configuration, buildroot configuration and benchmark are\n"
HELP+="              configured right.\n"
.PHONY: test
test: parse_kconfig initram_cyclictest
	scripts/test.py

HELP+="run         - Executes loop of kernel building, booting and benchmark execution.\n"
.PHONY: run
run: all
	scripts/loop.py

.PHONY: evaluate
evaluate:
	scripts/evaluate.py

HELP+="\n"

HELP+="clean           - Cleans all generated files. Except those in\n"
HELP+="                  linux and buildroot.\n"
.PHONY: clean
clean:
	@$(MAKE) -C scripts/parse_kconfig clean
	@$(MAKE) -C scripts/write_config clean
	@$(MAKE) -C scripts/allconfig clean
	@if [ -e scripts/picosat-959/makefile ]; then $(MAKE) -C scripts/picosat-959 clean; fi
	$(RM) .conf.mk
	$(RM) -r jobfiles

HELP+="clean_measure   - Removes working files used while measuring. After this,\n"
HELP+="                  initializations has to be executed once again.\n"
.PHONY: clean_measure
clean_measure:
	$(RM) -r configurations
	$(RM) -r output
	$(RM) -r result
	$(RM) $(CONF_DOT_CONFIG)

HELP+="clean_database  - Drop all tables in database.\n"
.PHONY: cleandb clean_database
cleandb: clean_database
clean_database:
	PGPASSWORD="$(CONF_DB_PASSWORD)" psql -d "$(CONF_DB_DATABASE)" -h "$(CONF_DB_HOST)" -p "$(CONF_DB_PORT)" -f scripts/databaseclean.sql

HELP+="distclean       - Cleans all configurations and generated files.\n"
HELP+="                  Including linux and buildroot.\n"
.PHONY: distclean
distclean: clean distclean_linux distclean_buildroot clean_measure

HELP+="clean_linux     - Executes 'make clean' in linux folder.\n"
.PHONY: clean_linux
clean_linux:
	@$(MAKE) -C $(CONF_LINUX_SOURCES) clean

HELP+="distclean_linux - Executes 'make distclean' in linux folder.\n"
.PHONY: distclean_linux
distclean_linux:
	@$(MAKE) -C $(CONF_LINUX_SOURCES) distclean

.PHONY: clean_buildroot
clean_buildroot:
	@$(MAKE) -C tests/cyclictest/root/ clean

.PHONY: distclean_buildroot
distclean_buildroot:
	@$(MAKE) -C tests/cyclictest/root/ distclean

#######################################

.conf.mk: conf.py .target
	scripts/confmk.py

.target:
	$(error Please select target by writing it to .target file)

.PHONY: parse_kconfig
parse_kconfig:
	@if [ `$(MAKE) -C scripts/parse_kconfig/ -q; echo $$?` != "0" ]; then \
	$(MAKE) -C scripts/parse_kconfig/; fi

.PHONY: write_config
write_config:
	@if [ `$(MAKE) -C scripts/write_config/ -q; echo $$?` != "0" ]; then \
	$(MAKE) -C scripts/write_config/; fi

.PHONY:allconfig
allconfig:
	@if [ `$(MAKE) -C scripts/allconfig/ -q; echo $$?` != "0" ]; then \
	$(MAKE) -C scripts/allconfig/; fi

.PHONY: picosat
picosat:
	@if [ ! -e scripts/picosat-959/makefile ]; then \
	cd scripts/picosat-959 && ./configure; fi
	@if [ `$(MAKE) -C scripts/picosat-959 -q; echo $$?` != "0" ]; then \
	$(MAKE) -C scripts/picosat-959; fi

.PHONY: initram_cyclictest
initram_cyclictest:
	@if [ `$(MAKE) -C tests/cyclictest/root/ -q; echo $$?` != "0" ]; then \
	$(MAKE) -C scripts/cyclictest/root/; fi