-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (42 loc) · 2.03 KB
/
Copy pathMakefile
File metadata and controls
59 lines (42 loc) · 2.03 KB
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
CXX = g++
INCLUDES = -Iinclude
CXXFLAGS = -lstdc++ -std=c++0x -O
## FILES = VirtualMachine CentralProcessingUnit ControlUnit ArithmeticalLogicalUnit
## SRCDIR = src/
## SRC = $(SRCDIR)/$(FILES).cpp
## SRC = $(SRCDIR)/VirtualMachine.cpp $(SRCDIR)/CentralProcessingUnit.cpp $(SRCDIR)/ControlUnit.cpp $(SRCDIR)/ArithmeticalLogicalUnit.cpp
INCDIR = include/
## OBJ = $(SRC:.cpp=.o)
## EXECUTABLE = vm
## main targets:
.PHONY: vm
vm: main_vm.o VirtualMachine.o CentralProcessingUnit.o ControlUnit.o Ram.o ArithmeticalLogicalUnit.o CommunicationChannel.o CommunicationUnit.o
$(CXX) -o vm $^
.PHONY: asm
asm: main_asm.o Assembler.o
$(CXX) -o asm $^
## secondary VM targets:
VirtualMachine.o: src/VirtualMachine.cpp include/VirtualMachine.hpp
$(CXX) $(CXXFLAGS) -c $(INCLUDES) src/VirtualMachine.cpp -o $@
CentralProcessingUnit.o: src/CentralProcessingUnit.cpp include/CentralProcessingUnit.hpp
$(CXX) $(CXXFLAGS) -c $(INCLUDES) src/CentralProcessingUnit.cpp -o $@
ControlUnit.o: src/ControlUnit.cpp include/ControlUnit.hpp include/Instructions_VM.hpp
$(CXX) $(CXXFLAGS) -c $(INCLUDES) src/ControlUnit.cpp -o $@
Ram.o: src/Ram.cpp include/Ram.hpp
$(CXX) $(CXXFLAGS) -c $(INCLUDES) src/Ram.cpp -o $@
ArithmeticalLogicalUnit.o: src/ArithmeticalLogicalUnit.cpp include/ArithmeticalLogicalUnit.hpp
$(CXX) $(CXXFLAGS) -c $(INCLUDES) src/ArithmeticalLogicalUnit.cpp -o $@
CommunicationUnit.o: src/CommunicationUnit.cpp include/CommunicationUnit.hpp
$(CXX) $(CXXFLAGS) -c $(INCLUDES) src/CommunicationUnit.cpp -o $@
CommunicationChannel.o: src/CommunicationChannel.cpp include/CommunicationChannel.hpp
$(CXX) $(CXXFLAGS) -c $(INCLUDES) src/CommunicationChannel.cpp -o $@
main_vm.o: main_vm.cpp
$(CXX) $(CXXFLAGS) -c $(INCLUDES) main_vm.cpp -o $@
## secondary ASM targets:
Assembler.o: src/Assembler.cpp include/Assembler.hpp include/Instructions_VM.hpp include/Instructions_ASM.hpp
$(CXX) $(CXXFLAGS) -c $(INCLUDES) src/Assembler.cpp -o $@
main_asm.o: main_asm.cpp
$(CXX) $(CXXFLAGS) -c $(INCLUDES) main_asm.cpp -o $@
.PHONY: clean
clean:
rm -f *.o