-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
100 lines (74 loc) · 2.56 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
dir_guard=@mkdir -p
res_cp=@cp -R
CXX=g++
INC=-Iinclude
LIB=-L/usr/lib -Llib -lX11 -lXtst -lopencv_core -lopencv_flann -lopencv_video
CXXFLAGS=-O0 -std=gnu++11 -g -Wall
LIBDIR=lib
BINDIR=bin
SRCDIR=src
RESDIR=res
CORE_MODULE=core
CORE_SRCDIR=$(SRCDIR)/$(CORE_MODULE)/
CORE_LIBDIR=$(LIBDIR)/$(CORE_MODULE)/
CORE_MKDIR=$(dir_guard) $(CORE_LIBDIR)
CORE_DEPS=$(CORE_LIBDIR)util.o $(CORE_LIBDIR)x11_controller.o $(CORE_LIBDIR)locate_enemies.o $(CORE_LIBDIR)locate_doors.o $(CORE_LIBDIR)localize.o
EXPERIMENTS_MODULE=experiments
EXPERIMENT_EXEC=x11_screen_grab x11_send_event image_scale_up image_scale_down gaussian_blur sift cv_sift_door_finder door_segment
EXPERIMENTS_SRCDIR=$(SRCDIR)/$(EXPERIMENTS_MODULE)/
EXPERIMENTS_LIBDIR=$(LIBDIR)/$(EXPERIMENTS_MODULE)/
EXPERIMENTS_BINDIR=$(BINDIR)/$(EXPERIMENTS_MODULE)/
EXPERIMENTS_RESDIR=$(RESDIR)/$(EXPERIMENTS_MODULE)/
EXPERIMENT_MKDIR=$(dir_guard) $(EXPERIMENTS_BINDIR) $(EXPERIMENTS_LIBDIR)
EXPERIMENT_RESCP=$(res_cp) $(EXPERIMENTS_RESDIR)/* $(EXPERIMENTS_BINDIR)
define compile_core
$(CORE_MKDIR)
$(CXX) $(INC) $(CXXFLAGS) -c $(basename $(subst $(CORE_LIBDIR), $(CORE_SRCDIR), $@)).cpp -o $@
endef
define make_experiments
$(EXPERIMENT_MKDIR)
$(EXPERIMENT_RESCP)
$(CXX) $(INC) $(CXXFLAGS) -c $(EXPERIMENTS_SRCDIR)[email protected] -o $(EXPERIMENTS_LIBDIR)[email protected]
$(CXX) $(INC) $(CXXFLAGS) -o $(EXPERIMENTS_BINDIR)$@ $(EXPERIMENTS_LIBDIR)[email protected] $^ `pkg-config --libs opencv` $(LIB)
endef
all: $(EXPERIMENT_EXEC)
x11_screen_grab:
$(call make_experiments)
x11_send_event:
$(call make_experiments)
image_scale_up:
$(call make_experiments)
image_scale_down:
$(call make_experiments)
gaussian_blur:
$(call make_experiments)
cv_sift_door_finder:
$(call make_experiments)
sift:
$(call make_experiments)
door_segment:
$(call make_experiments)
door_segment2: $(CORE_LIBDIR)util.o $(CORE_LIBDIR)locate_doors.o
$(call make_experiments)
enemy_segment: $(CORE_LIBDIR)util.o $(CORE_LIBDIR)locate_enemies.o
$(call make_experiments)
wall_measure: $(CORE_LIBDIR)localize.o
$(call make_experiments)
reorient:
$(call make_experiments)
wolf3d_ai: $(CORE_DEPS)
$(CXX) $(INC) $(CXXFLAGS) -c $(SRCDIR)/[email protected] -o $(LIBDIR)/[email protected]
$(CXX) $(INC) $(CXXFLAGS) -o $(BINDIR)/$@ $(LIBDIR)/[email protected] $^ `pkg-config --libs opencv` $(LIB)
$(CORE_LIBDIR)x11_controller.o: $(CORE_LIBDIR)util.o
$(call compile_core)
$(CORE_LIBDIR)locate_enemies.o: $(CORE_LIBDIR)util.o
$(call compile_core)
$(CORE_LIBDIR)locate_doors.o: $(CORE_LIBDIR)util.o
$(call compile_core)
$(CORE_LIBDIR)localize.o:
$(call compile_core)
$(CORE_LIBDIR)util.o:
$(call compile_core)
clean:
-rm -rf bin/*
-rm -rf lib/*