-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
65 lines (49 loc) · 2.05 KB
/
Copy pathmakefile
File metadata and controls
65 lines (49 loc) · 2.05 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
60
61
62
63
64
65
.PHONY: clean
CC=gcc
CFLAGS = -Wall -Wextra -ansi -pedantic
BASE_UTILS = setting.o text.o errors.o
FILE_STRUCTURES = codeSeg.o dataSeg.o symbolTable.o entryLines.o fileStructures.o
OBJECTS = setting.o text.o errors.o \
linkedList.o vector.o machineWord.o \
symbolTable.o dataSeg.o codeSeg.o entryLines.o fileStructures.o externUsages.o \
preAssembler.o \
analysis.o fsm.o firstAnalysis.o firstPass.o \
secondPass.o
assembler: assembler.o
$(CC) $(CFLAGS) *.o -o assembler
############################ building
# building object files from utils
%.o: utils/%.c
$(CC) $(CFLAGS) -c $< -o $@
# building object files from fileStructures
%.o: fileStructures/%.c
$(CC) $(CFLAGS) -c $< -o $@
# building object files from source
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
############################ Dependencies
assembler.o: $(OBJECTS)
secondPass.o: $(BASE_UTILS) $(FILE_STRUCTURES) externUsages.o
firstPass.o: $(BASE_UTILS) $(FILE_STRUCTURES) firstAnalysis.o
firstAnalysis.o: $(BASE_UTILS) codeSeg.o dataSeg.o symbolTable.o analysis.o fsm.o
fsm.o: $(BASE_UTILS) codeSeg.o dataSeg.o symbolTable.o analysis.o
analysis.o: $(BASE_UTILS) codeSeg.o dataSeg.o symbolTable.o entryLines.o fileStructures.o
preAssembler.o: $(BASE_UTILS) linkedList.o fileStructures.o
# dependencies of files from fileStructure
externUsages.o: setting.o vector.o codeSeg.o linkedList.o fileStructures.o
fileStructures.o: symbolTable.o dataSeg.o codeSeg.o entryLines.o errors.o
entryLines.o: setting.o text.o vector.o linkedList.o symbolTable.o
codeSeg.o: setting.o text.o vector.o machineWord.o
dataSeg.o: setting.o vector.o machineWord.o
symbolTable.o: setting.o linkedList.o
# dependencies of files from utils
errors.o: text.o
text.o: setting.o
machineWord.o: setting.o
# setting.o, linkedList.o and vector.o are not depend on anything
############################ Clean rules
clean:
rm -f *.o assembler
# Clean assembler output
cleanOutput:
rm -f *.am *.ob *ext *ent