-
Notifications
You must be signed in to change notification settings - Fork 73
/
Makefile
58 lines (42 loc) · 905 Bytes
/
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
.PHONY: clean, mrproper
PROJECT = emeocv
OPENCV = $(shell pkg-config --exists opencv4 && echo opencv4)
ifneq ($(OPENCV), opencv4)
OPENCV = opencv
endif
OBJS = $(addprefix $(OUTDIR)/,\
Directory.o \
Config.o \
ImageProcessor.o \
ImageInput.o \
KNearestOcr.o \
Plausi.o \
RRDatabase.o \
main.o \
)
CC = g++
CFLAGS = -Wno-write-strings -I . `pkg-config $(OPENCV) --cflags`
# DEBUG
ifneq ($(RELEASE),true)
CFLAGS += -g -D _DEBUG
OUTDIR = Debug
else
OUTDIR = Release
endif
BIN := $(OUTDIR)/$(PROJECT)
LDLIBS = `pkg-config $(OPENCV) --libs` -lrrd -llog4cpp
SUFFIXES= .cpp .o
.SUFFIXES: $(SUFFIXES) .
all: $(BIN)
$(OUTDIR):
mkdir $(OUTDIR)
$(OBJS): $(OUTDIR)/%.o: %.cpp
$(CC) $(CFLAGS) -c $< -o $@
$(BIN) : $(OUTDIR) $(OBJS)
$(CC) $(CFLAGS) $(LDFALGS) $(OBJS) $(LDLIBS) -o $(BIN)
.cpp.o:
$(CC) $(CFLAGS) -c $*.cpp
clean:
rm -rf $(OUTDIR)/*.o
mrproper: clean
rm -rf $(BIN)