-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (47 loc) · 2.82 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
OBJS = bin/Main.o bin/FileReader.o bin/Token.o bin/TokenHistogram.o \
bin/Tokenizer.o bin/SpellingCorrector.o bin/TokenEditor.o bin/IteratorInterface.o \
bin/MySQLInterface.o bin/DatabaseConfigReader.o bin/SpellingCorrectorTrainer.o \
bin/Ngram.o bin/MySQLInsertionThread.o bin/JSONReader.o bin/SpellingCorrectorInitializer.o
CC = g++
DEBUG = -g
CFLAGS = -c -Wall -std=c++14 -I/usr/include/cppconn -lpthread $(DEBUG)
LFLAGS = -lmysqlcppconn -lcrypto -lboost_program_options -lboost_iostreams -lpthread $(DEBUG)
.PHONY: directories
all: directories bin/SpellingCorrectorTrainer
directories: bin
bin:
mkdir bin
bin/SpellingCorrectorTrainer : $(OBJS)
$(CC) -o bin/SpellingCorrectorTrainer $(OBJS) $(LFLAGS)
bin/Main.o : src/Main.cpp src/SpellingCorrector.h src/SpellingCorrectorTrainer.h src/Ngram.h
$(CC) $(CFLAGS) src/Main.cpp -o bin/Main.o
bin/FileReader.o : src/util/FileReader.*
$(CC) $(CFLAGS) src/util/FileReader.cpp -o bin/FileReader.o
bin/Token.o : src/Token.* src/TokenEditor.h
$(CC) $(CFLAGS) src/Token.cpp -o bin/Token.o
bin/TokenHistogram.o : src/TokenHistogram.* src/Token.h
$(CC) $(CFLAGS) src/TokenHistogram.cpp -o bin/TokenHistogram.o
bin/Tokenizer.o : src/Tokenizer.* src/Token.h src/util/FileReader.h
$(CC) $(CFLAGS) src/Tokenizer.cpp -o bin/Tokenizer.o
bin/SpellingCorrector.o : src/SpellingCorrector.* src/Tokenizer.h src/TokenHistogram.h src/util/FileReader.h
$(CC) $(CFLAGS) src/SpellingCorrector.cpp -o bin/SpellingCorrector.o
bin/SpellingCorrectorTrainer.o : src/SpellingCorrectorTrainer.* src/util/FileReader.h src/Tokenizer.h src/util/MySQLInterface.h src/Token.h src/util/MD5FileHasher.h src/Ngram.h
$(CC) $(CFLAGS) src/SpellingCorrectorTrainer.cpp -o bin/SpellingCorrectorTrainer.o
bin/TokenEditor.o : src/TokenEditor.* src/Token.h src/util/Helper.h
$(CC) $(CFLAGS) src/TokenEditor.cpp -o bin/TokenEditor.o
bin/IteratorInterface.o : src/util/IteratorInterface.*
$(CC) $(CFLAGS) src/util/IteratorInterface.cpp -o bin/IteratorInterface.o
bin/MySQLInterface.o : src/util/MySQLInterface.* src/util/MySQLInsertionThread.h
$(CC) $(CFLAGS) src/util/MySQLInterface.cpp -o bin/MySQLInterface.o
bin/DatabaseConfigReader.o : config/DatabaseConfigReader.* src/util/MySQLInterface.h config/JSONReader.h
$(CC) $(CFLAGS) config/DatabaseConfigReader.cpp -o bin/DatabaseConfigReader.o
bin/Ngram.o : src/Ngram.* src/Token.h
$(CC) $(CFLAGS) src/Ngram.cpp -o bin/Ngram.o
bin/MySQLInsertionThread.o : src/util/MySQLInsertionThread.*
$(CC) $(CFLAGS) src/util/MySQLInsertionThread.cpp -o bin/MySQLInsertionThread.o
bin/JSONReader.o : config/JSONReader.*
$(CC) $(CFLAGS) config/JSONReader.cpp -o bin/JSONReader.o
bin/SpellingCorrectorInitializer.o : src/SpellingCorrectorInitializer.* config/JSONReader.h src/util/MySQLInterface.h
$(CC) $(CFLAGS) src/SpellingCorrectorInitializer.cpp -o bin/SpellingCorrectorInitializer.o
clean:
rm -rf bin/*