-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile.linux
84 lines (62 loc) · 3.17 KB
/
Makefile.linux
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
# Linux Makefile for PCRF tools
# Try "sudo make -f Makefile.linux install"
# (assumes that an directories /usr/local/bin and /usr/local/share/man exist)
# You need the following:
# - A newer version of boost (www.boost.org) (apt-get install libboost-all-dev)
# - The doxygen documentation tool (apt-get install doxygen)
MAN_DEST_DIR = /usr/local/share/man
BIN_DEST_DIR = /usr/local/bin
# Fill in path for TCLAP
TCLAP_INCL = ./include
CRF_MODEL_INCLUDES = include/SimpleLinearCRFModel.hpp include/CRFTypedefs.hpp include/StringUnsignedMapper.hpp
CRF_TRAINING_INCLUDES = $(CRF_MODEL_INCLUDES) include/CRFTrainingCorpus.hpp include/CRFDecoder.hpp \
include/CRFTraining.hpp include/AveragedPerceptronCRFTrainer.hpp
CRF_ANNOTATE_INCLUDES = include/CRFFeatureExtractor.hpp include/CRFConfiguration.hpp include/AsyncTokenizer.hpp \
include/TokenWithTag.hpp include/tokenizer.hpp include/next_token.cpp include/WDAWG.hpp
CRF_APPLY_INCLUDES = include/CRFApplier.hpp $(CRF_MODEL_INCLUDES) $(CRF_ANNOTATE_INCLUDES) \
include/CRFDecoder.hpp include/NEROutputters.hpp
# Binaries
CRF_ANNOTATE = crf-annotate
NER_ANNOTATE = ner-annotate
CRF_TRAIN = crf-train
CRF_APPLY = crf-apply
CRF_CONVERT = crf-convert
CL_OPTIONS = -I $(TCLAP_INCL) -O3 -std=c++11 -DPCRF_UTF8_SUPPORT
#CC_COMP = clang++-3.5
CC_COMP = g++
all : binaries documentation
binaries: $(CRF_ANNOTATE) $(CRF_TRAIN) $(CRF_APPLY) $(CRF_CONVERT)
cd python-wrapper ; make
documentation :
if [ ! -d "doc/html" ]; then cd doc ; doxygen pcrf.doxygen; fi
install: all
sudo cp $(CRF_ANNOTATE) $(CRF_TRAIN) $(CRF_APPLY) $(CRF_CONVERT) $(BIN_DEST_DIR)
sudo mkdir -p $(MAN_DEST_DIR)/man1 $(MAN_DEST_DIR)/man5
sudo cp doc/crf-annotate.man.1 $(MAN_DEST_DIR)/man1/crf-annotate.1
sudo cp doc/crf-train.man.1 $(MAN_DEST_DIR)/man1/crf-train.1
sudo cp doc/crf-apply.man.1 $(MAN_DEST_DIR)/man1/crf-apply.1
sudo cp doc/crf-annotate.man.5 $(MAN_DEST_DIR)/man5/crf-annotate.5
sudo cp doc/crf-train.man.5 $(MAN_DEST_DIR)/man5/crf-train.5
sudo cp doc/crf-conf.man.5 $(MAN_DEST_DIR)/man5/crf-conf.5
sudo cp doc/crf-conf.man.5 $(MAN_DEST_DIR)/man5/crf-apply.5
sudo gzip -f $(MAN_DEST_DIR)/man1/crf-annotate.1
sudo gzip -f $(MAN_DEST_DIR)/man1/crf-train.1
sudo gzip -f $(MAN_DEST_DIR)/man1/crf-apply.1
sudo gzip -f $(MAN_DEST_DIR)/man5/crf-annotate.5
sudo gzip -f $(MAN_DEST_DIR)/man5/crf-train.5
sudo gzip -f $(MAN_DEST_DIR)/man5/crf-conf.5
sudo gzip -f $(MAN_DEST_DIR)/man5/crf-apply.5
sudo mandb
$(CRF_ANNOTATE) : src/crf-annotate.cpp $(CRF_ANNOTATE_INCLUDES) include/CRFHelpers.hpp
$(CC_COMP) $(CL_OPTIONS) -o $(CRF_ANNOTATE) src/crf-annotate.cpp
cp $(CRF_ANNOTATE) $(NER_ANNOTATE)
$(CRF_TRAIN) : src/crf-train.cpp $(CRF_TRAINING_INCLUDES)
$(CC_COMP) $(CL_OPTIONS) -o $(CRF_TRAIN) src/crf-train.cpp
$(CRF_APPLY) : src/crf-apply.cpp $(CRF_APPLY_INCLUDES)
$(CC_COMP) $(CL_OPTIONS) -o $(CRF_APPLY) src/crf-apply.cpp
$(CRF_CONVERT): src/crf-convert.cpp $(CRF_MODEL_INCLUDES)
$(CC_COMP) $(CL_OPTIONS) -o $(CRF_CONVERT) src/crf-convert.cpp
clean:
rm -f *.o $(NER_ANNOTATE) $(CRF_ANNOTATE) $(CRF_TRAIN) $(CRF_APPLY) $(CRF_CONVERT)
rm -rf doc/html
cd python-wrapper ; make clean