-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
84 lines (61 loc) · 1.53 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
84
ICDIR ?= $(abspath ../xzintbit)
include $(ICDIR)/intcode.mk
BINDIR ?= bin
OBJDIR ?= obj
SRCDIRS = util cga cpu dev fdc img vm
TOOLSDIR = tools/import-cleanup tools/monitor
TESTDIRS = test-bochs test-cpu
# Build VM
.PHONY: build
build: $(SRCDIRS)
.PHONY: $(SRCDIRS)
$(SRCDIRS):
make -C $@ build
.PHONY: run
run: build
make -C vm run
# Build tools
.PHONY: build-tools
build-tools: $(TOOLSDIR)
.PHONY: $(TOOLSDIR)
$(TOOLSDIR):
make -C $@
# Build tests
BUILD_TESTS_TARGETS = $(addprefix build-,$(TESTDIRS))
.PHONY: build-tests
build-tests: $(BUILD_TESTS_TARGETS)
.PHONY: $(BUILD_TESTS_TARGETS)
$(BUILD_TESTS_TARGETS):
make -C $(patsubst build-%,%,$@) build
.PHONY: build-all
build-all: build build-tools build-tests
# Run tests
.PHONY: test
test: test-bochs
.PHONY: test-all
test-all: test test-cpu
.PHONY: validate
validate: validate-bochs
.PHONY: validate-bochs
validate-bochs: build
make -C test-bochs validate
.PHONY: $(TESTDIRS)
$(TESTDIRS): build
make -C $@ test
.PHONY: imports
imports: tools/import-cleanup
node tools/import-cleanup/import-cleanup.js .
# Clean
CLEAN_TARGETS = $(addprefix clean-,$(SRCDIRS) $(TOOLSDIR) $(TESTDIRS))
.PHONY: clean
clean: $(CLEAN_TARGETS)
rm -rf $(BINDIR) $(OBJDIR)
.PHONY: $(CLEAN_TARGETS)
$(CLEAN_TARGETS):
make -C $(patsubst clean-%,%,$@) clean
VERY_CLEAN_TARGETS = very-clean-img very-clean-tools/import-cleanup very-clean-tools/monitor
.PHONY: very-clean
very-clean: clean $(VERY_CLEAN_TARGETS)
.PHONY: $(VERY_CLEAN_TARGETS)
$(VERY_CLEAN_TARGETS):
make -C $(patsubst very-clean-%,%,$@) very-clean