-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
82 lines (73 loc) · 2.58 KB
/
Makefile
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
################################################################################
#
# University of Luxembourg
# Laboratory of Algorithmics, Cryptology and Security (LACS)
#
# arm_v7m_leakage simulator
#
# Copyright (C) 2017 University of Luxembourg
#
# Written in 2017 by Yann Le Corre <[email protected]>
#
# This simulator is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# It is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
################################################################################
################################################################################
#
# Top-level makefile (mainly used for maintenance)
#
################################################################################
ALGO_DIRS := $(wildcard sec_*/.)
TRACE_OPT := # blank, should be overriden by command line assignment
.PHONY: help
help:
@echo "################################################################################"; \
echo "Targets:"; \
echo " all : compile library, firmware, and simulator for all ciphers"; \
echo " compile_lib : compile library"; \
echo " compile_fw : compile all firmwares"; \
echo " compile_sim : compile all simulators"; \
echo " check : all + perform some checks"; \
echo "################################################################################"
.PHONY: all
all: compile_lib compile_fw compile_sim
.PHONY: compile_fw
compile_fw:
@for dir in $(ALGO_DIRS); do \
echo "-- compiling FW in $$dir"; \
$(MAKE) -C $$dir/fw/build; \
done
.PHONY: compile_sim
compile_sim: compile_lib
@for dir in $(ALGO_DIRS); do \
echo "-- compiling SIM in $$dir"; \
$(MAKE) -C $$dir/sim/build $(TRACE_OPT); \
done
.PHONY: compile_lib
compile_lib:
echo "-- compiling library"; \
$(MAKE) -C libsim/build install; \
.PHONY: check
check: compile_lib compile_sim compile_fw
@for dir in $(ALGO_DIRS); do \
echo "-- checking $$dir"; \
$(MAKE) -C $$dir/fw/build check; \
done
.PHONY: clean
clean:
@for dir in $(ALGO_DIRS); do \
echo "-- cleaning directory $$dir"; \
$(MAKE) -C $$dir/sim/build clean; \
$(MAKE) -C $$dir/fw/build clean; \
done