This repository has been archived by the owner on May 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
165 lines (145 loc) · 5.14 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
FLAGS=-std=gnu90
FLAGS_THREAD=-pthread
BIN_FOLDER=./bin/
$(BIN_FOLDER)analyzer.o: ./src/analyzer/analyzer.c \
./src/analyzer/analyzer.h \
./src/manager/manager.h \
./src/list/list.h \
./src/priorityQueue/priorityQueue.h \
./src/table/table.h \
./src/tree/tree.h \
./src/wrapping/wrapping.h
gcc $(FLAGS) $(FLAGS_THREAD) -c ./src/analyzer/analyzer.c -o $(BIN_FOLDER)analyzer.o
$(BIN_FOLDER)manager.o: ./src/manager/manager.c \
./src/manager/manager.h \
./src/list/list.h \
./src/wrapping/wrapping.h \
./src/worker/worker.h \
./src/work/work.h
gcc $(FLAGS) $(FLAGS_THREAD) -c ./src/manager/manager.c -o $(BIN_FOLDER)manager.o
$(BIN_FOLDER)reporter.o: ./src/reporter/reporter.c \
./src/reporter/reporter.h \
./src/list/list.c
gcc $(FLAGS) $(FLAGS_THREAD) -c ./src/reporter/reporter.c -o $(BIN_FOLDER)reporter.o
$(BIN_FOLDER)list.o: ./src/list/list.c ./src/list/list.h
gcc $(FLAGS) -c ./src/list/list.c -o $(BIN_FOLDER)list.o
$(BIN_FOLDER)priorityQueue.o: ./src/priorityQueue/priorityQueue.c ./src/priorityQueue/priorityQueue.h
gcc $(FLAGS) -c ./src/priorityQueue/priorityQueue.c -o $(BIN_FOLDER)priorityQueue.o
$(BIN_FOLDER)table.o: ./src/table/table.c ./src/table/table.h
gcc $(FLAGS) -c ./src/table/table.c -o $(BIN_FOLDER)table.o
$(BIN_FOLDER)tree.o: ./src/tree/tree.c \
./src/list/list.h \
./src/tree/tree.h
gcc $(FLAGS) -c ./src/tree/tree.c -o $(BIN_FOLDER)tree.o
$(BIN_FOLDER)tui.o: ./src/tui/tui.c ./src/tui/tui.h
gcc $(FLAGS) $(FLAGS_THREAD) -c ./src/tui/tui.c -o $(BIN_FOLDER)tui.o
$(BIN_FOLDER)work.o: ./src/work/work.c ./src/work/work.h
gcc $(FLAGS) -c ./src/work/work.c -o $(BIN_FOLDER)work.o
$(BIN_FOLDER)worker.o: ./src/worker/worker.c ./src/worker/worker.h
gcc $(FLAGS) -c ./src/worker/worker.c -o $(BIN_FOLDER)worker.o
$(BIN_FOLDER)wrapping.o: ./src/wrapping/wrapping.c ./src/wrapping/wrapping.h
gcc $(FLAGS) -c ./src/wrapping/wrapping.c -o $(BIN_FOLDER)wrapping.o
$(BIN_FOLDER)main.o: ./src/main.c
gcc $(FLAGS) -c ./src/main.c -o $(BIN_FOLDER)main.o
.SILENT:
help:
echo -e "Makefile help\n \
* build : compiles the program and creates the executable files and object files\n \
* buildMinimal : compiles the program and creates only the executable files\n \
* clean : removes all file created during any kind of build operation\n \
* cleanObj : removes all object files created during any kind of build operation\n \
* help : print this file\n \
* log : compiles the program with a preprocessor directive which redirects all components errors in a log file.\n \
Then it creates the executable files and object files\n \
* speed : compiles the program with a preprocessor directive which ignores all the sleeps.\n \
Then it creates the executable files"
makeDir:
[ -d bin ] || mkdir bin
build: makeDir \
clean \
$(BIN_FOLDER)main.o \
$(BIN_FOLDER)analyzer.o \
$(BIN_FOLDER)manager.o \
$(BIN_FOLDER)reporter.o \
$(BIN_FOLDER)list.o \
$(BIN_FOLDER)priorityQueue.o \
$(BIN_FOLDER)table.o \
$(BIN_FOLDER)tree.o \
$(BIN_FOLDER)tui.o \
$(BIN_FOLDER)work.o \
$(BIN_FOLDER)worker.o \
$(BIN_FOLDER)wrapping.o
echo "building..."
gcc $(FLAGS) $(FLAGS_THREAD) -o $(BIN_FOLDER)analyzer \
$(BIN_FOLDER)analyzer.o \
$(BIN_FOLDER)list.o \
$(BIN_FOLDER)priorityQueue.o \
$(BIN_FOLDER)table.o \
$(BIN_FOLDER)tree.o \
$(BIN_FOLDER)wrapping.o
gcc $(FLAGS) -o $(BIN_FOLDER)counter \
$(BIN_FOLDER)main.o \
$(BIN_FOLDER)list.o \
$(BIN_FOLDER)work.o \
$(BIN_FOLDER)wrapping.o
gcc $(FLAGS) -o $(BIN_FOLDER)worker \
$(BIN_FOLDER)table.o \
$(BIN_FOLDER)worker.o \
$(BIN_FOLDER)wrapping.o
gcc $(FLAGS) $(FLAGS_THREAD) -o $(BIN_FOLDER)manager \
$(BIN_FOLDER)manager.o \
$(BIN_FOLDER)list.o \
$(BIN_FOLDER)table.o \
$(BIN_FOLDER)wrapping.o \
$(BIN_FOLDER)work.o
gcc $(FLAGS) $(FLAGS_THREAD) -o $(BIN_FOLDER)reporter \
$(BIN_FOLDER)list.o \
$(BIN_FOLDER)reporter.o \
$(BIN_FOLDER)wrapping.o \
$(BIN_FOLDER)tui.o
gcc $(FLAGS) $(FLAGS_THREAD) -o $(BIN_FOLDER)counter\
$(BIN_FOLDER)main.o \
$(BIN_FOLDER)wrapping.o
echo "done"
log: build \
$(BIN_FOLDER)main.o \
$(BIN_FOLDER)wrapping.o
echo "adding log option..."
gcc $(FLAGS) $(FLAGS_THREAD) -D LOG -o $(BIN_FOLDER)counter\
./src/main.c \
$(BIN_FOLDER)wrapping.o
echo "done"
clean:
rm -rf $(BIN_FOLDER)*
cleanObj:
rm -rf $(BIN_FOLDER)*.o
buildMinimal: build \
cleanObj
speed: buildMinimal
echo "i'm speeding up"
gcc $(FLAGS) $(FLAGS_THREAD) -D SLEEP_FLAG \
./src/analyzer/analyzer.c \
./src/priorityQueue/priorityQueue.c \
./src/table/table.c \
./src/tree/tree.c \
./src/list/list.c \
./src/wrapping/wrapping.c \
-o $(BIN_FOLDER)analyzer
gcc $(FLAGS) $(FLAGS_THREAD) -D SLEEP_FLAG \
./src/reporter/reporter.c \
./src/tui/tui.c \
./src/list/list.c \
./src/wrapping/wrapping.c \
-o $(BIN_FOLDER)reporter
gcc $(FLAGS) $(FLAGS_THREAD) -D SLEEP_FLAG \
./src/worker/worker.c \
./src/wrapping/wrapping.c \
-o $(BIN_FOLDER)worker
gcc $(FLAGS) $(FLAGS_THREAD) -D SLEEP_FLAG \
./src/manager/manager.c \
./src/table/table.c \
./src/list/list.c \
./src/wrapping/wrapping.c \
./src/work/work.c \
-o $(BIN_FOLDER)manager
echo "done"