-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (49 loc) · 1.24 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
PROG = remuir
ROOT = $(shell pwd)
BUILD = ./target/debug
RELEASE = ./target/release
BIN = $(abspath $(BUILD)/$(PROG))
ARGS ?=
# Compilation Flags
CFLAGS = -std=gnu11 \
-O2 -MMD -Wall -Werror \
-fno-asynchronous-unwind-tables -fno-builtin -fno-stack-protector \
-Wno-main -U_FORTIFY_SOURCE
CXXFLAGS = $(CFLAGS) -ffreestanding -fno-rtti -fno-exceptions
ASFLAGS = -MMD
LDFLAGS = -z noexecstack
include config.mk
-include input/scripts/am.mk
include tools/difftest.mk
override ARGS += $(ARGS_DIFF)
# Tags
all: default
# Default run mode: no image loaded
default: build $(DIFF_REF_SO)
@$(BIN) $(ARGS)
# Default binary is dummy.bin
# help: make run NAME=[C file in input/tests/]
run: build image $(DIFF_REF_SO)
@$(BIN) $(IMAGE).bin $(ARGS)
build:
@cargo build
# build production version
release:
@cargo build --release
prod: image $(DIFF_REF_SO)
@cargo run --release $(IMAGE).bin $(ARGS)
lint:
@cargo check
format:
@cargo fmt
clean:
-rm -rf $(IPT_BUILD)
@cargo clean
count:
@echo [input]
@find ./input -name "*.[chS]" -or -name "*.ld" -type f | xargs wc -l
@echo
@echo [rust]
@find ./src -name "*.rs" -type f | xargs wc -l
.DEFAULT_GOAL := all
.PHONY: all default run build release lint format clean count image