-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
67 lines (49 loc) · 987 Bytes
/
makefile
File metadata and controls
67 lines (49 loc) · 987 Bytes
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
include ./make.conf
VM ?=
VM_DIR =
ifeq ($(VM),register_vm)
VM = vm/register_vm.o \
vm/register_vm/fetch.o \
vm/register_vm/decode.o \
vm/register_vm/execute.o \
vm/register_vm/run.o
VM_DIR = vm/register_vm
else
VM = vm/stack_vm.o \
vm/stack_vm/fetch.o \
vm/stack_vm/decode.o \
vm/stack_vm/execute.o \
vm/stack_vm/run.o \
vm/stack_vm/pop.o \
vm/stack_vm/push.o
VM_DIR = vm/stack_vm
endif
OBJECTS = \
main.o \
ss_asm/ss_asm.o \
ss_asm/make_code.o \
vm/vm.o \
vm/get_data.o \
vm/get_type.o \
$(VM)
OBJECT_DIRS = $(sort $(dir $(OBJECTS)))
SOURCES =
.PHONY: all bin
all: $(BINARY)
$(BINARY): $(OBJECTS) | bin
$(CXX) -o $@ -g $^ $(CXXFLAGS) $(LDFLAGS)
%.o: %.cpp
$(CXX) -c -g -o $@ $< $(CXXFLAGS)
bin:
@mkdir -p $@
.PHONY: run clean
run: $(BINARY)
./$<
clean:
rm -fr $(BINARY)
find . -name "*.o" -exec rm -fr {} \;
$(OBJECTS):
# $(OBJECT_DIRS):
# @for d in $@; do \
# echo $$d here; \
# done