-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
83 lines (70 loc) · 2.81 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
82
83
#
# IIS2MDC makefile
# Philipp Schilk, 2022
# Free to use with no restrictions but no guarantees.
#
################################################################################
# ____ _____ _____ _____ ___ _ _ ____ ____
# / ___|| ____|_ _|_ _|_ _| \ | |/ ___/ ___|
# \___ \| _| | | | | | || \| | | _\___ \
# ___) | |___ | | | | | || |\ | |_| |___) |
# |____/|_____| |_| |_| |___|_| \_|\____|____/
#
#################################################################################
# Reginald commit to use:
REGINALD_COMMIT_LOCK=80ee99a
# Files generated by reginald:
REGINALD_OUTPUT_FILES= inc/iis2mdc_regs.h inc/iis2mdc_enums.h inc/iis2mdc_reg_utils.h
# Reginald location:
REGINALD_REPO=scripts/reginald
REGINALD=$(REGINALD_REPO)/run.py
REGINALD_PYTHON=$(REGINALD_REPO)/env/bin/python
################################################################################
# _ _ _____ ___ _ ___ _______ __
# | | | |_ _|_ _| | |_ _|_ _\ \ / /
# | | | | | | | || | | | | | \ V /
# | |_| | | | | || |___ | | | | | |
# \___/ |_| |___|_____|___| |_| |_|
#
################################################################################
.PHONY: all
all: $(REGINALD_OUTPUT_FILES)
.PHONY: clean
clean:
rm $(REGINALD_OUTPUT_FILES)
rm $(REGINALD_REPO) -rf
.PHONY: format
format:
python3 scripts/clang_format.py
# Generate documentation using doxygen:
.PHONY: doc
doc:
doxygen
firefox doc/html/index.html
# Generate register header files using reginald:
.PHONY: $(REGINALD_OUTPUT_FILES)
$(REGINALD_OUTPUT_FILES) &: iis2mdc_regs.yaml $(REGINALD)
$(SILENT) $(REGINALD_PYTHON) $(REGINALD) iis2mdc_regs.yaml c.funcpack inc/ --no-field-enum-prefix
$(SILENT) clang-format -i -style=file $(REGINALD_OUTPUT_FILES)
# Setup the correct version of reginald:
$(REGINALD): | $(REGINALD_REPO)
@echo ""
@echo "==== Installing Reginald: Reginald checkout... =========================================="
@echo ""
$(SILENT) git -C $(REGINALD_REPO) checkout $(REGINALD_COMMIT_LOCK)
@echo ""
@echo "==== Installing reginald dependencies into venv... ======================================"
@echo ""
$(SILENT) $(REGINALD_PYTHON) -m pip install -r scripts/reginald/requirements.txt
@echo ""
@echo "==== Reginald Ready! ===================================================================="
@echo ""
$(REGINALD_REPO):
@echo ""
@echo "==== Installing Reginald: Cloning Reginald repo... ======================================"
@echo ""
$(SILENT) git clone [email protected]:schilkp/reginald.git scripts/reginald
@echo ""
@echo "==== Setting up python venv... =========================================================="
@echo ""
$(SILENT) python -m venv $(REGINALD_REPO)/env