-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
68 lines (55 loc) · 1.96 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
all: build test
# The include directive is used after the 'all' rule to make sure that the 'all' rule is the first rule in the makefile.
include makefile.variable
build: ${ASSEMBLER} ${LINKER} ${EMULATOR}
${ASSEMBLER}: FORCE ${COMMON} | ${BIN_DIR}
@echo "Building assembler..."
@${MAKE} --no-print-directory -C ${ASSEMBLER} build
@cp ${ASSEMBLER}/${ASSEMBLER} ${BIN_DIR}/${ASSEMBLER}
@export INDENT=""
@echo "Done building assembler."
${LINKER}: FORCE ${COMMON} | ${BIN_DIR}
@echo "Building linker..."
@${MAKE} --no-print-directory -C ${LINKER} build
@cp ${LINKER}/${LINKER} ${BIN_DIR}/${LINKER}
@echo "Done building linker."
${EMULATOR}: FORCE ${COMMON} | ${BIN_DIR}
@echo "Building emulator..."
@${MAKE} --no-print-directory -C ${EMULATOR} build
@cp ${EMULATOR}/${EMULATOR} ${BIN_DIR}/${EMULATOR}
@echo "Done building emulator."
${COMMON}: FORCE ${BIN_DIR}
@echo "Building common..."
@${MAKE} --no-print-directory -C ${COMMON} build
@echo "Done building common."
${BIN_DIR}:
@mkdir -p ${BIN_DIR}
test: mytests publictests
mytests: build FORCE
@echo "Running assembler tests..."
@${MAKE} --no-print-directory -C ${ASSEMBLER} test
@echo "Done running ${ASSEMBLER} tests."
@echo "Running linker tests..."
@${MAKE} --no-print-directory -C ${LINKER} test
@echo "Done running ${LINKER} tests."
@echo "Running emulator tests..."
@${MAKE} --no-print-directory -C ${EMULATOR} test
@echo "Done running ${EMULATOR} tests."
publictests: build FORCE
@echo "Running integration tests..."
@${MAKE} --no-print-directory -C ${TESTS}
@echo "Done running integration tests."
clean:
@echo "Cleaning..."
@${MAKE} --no-print-directory -C ${ASSEMBLER} clean
@${MAKE} --no-print-directory -C ${LINKER} clean
@${MAKE} --no-print-directory -C ${EMULATOR} clean
@${MAKE} --no-print-directory -C ${TESTS} clean
@${MAKE} --no-print-directory -C ${COMMON} clean
@rm -f ${BIN_DIR}/*
@echo "Done cleaning."
commit: clean
@source updateLineCount.sh
@git add .
@git commit ./
@git push