annotate c/Makefile @ 1145:66f063ca2d24

bug correction for makefile
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 28 Apr 2020 10:17:49 -0400
parents 05ccd8ef150c
children e1e7acef8eab
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
162
61fd5aff418c added basics to run tests
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 144
diff changeset
1 EXE_DIR=../bin
88
626560624d55 added the simple script to create directories
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 84
diff changeset
2 SCRIPTS_DIR=../scripts
1145
66f063ca2d24 bug correction for makefile
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 1093
diff changeset
3 TRAJECTORYMANAGEMENT_DIR=../../trajectorymanagementandanalysis/trunk/src/TrajectoryManagementAndAnalysis
4
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
4
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
5 CXX = g++
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
6
133
63dd4355b6d1 saving of feature positions in sqlite database
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 129
diff changeset
7 INCLUDE = -I../include -I$(TRAJECTORYMANAGEMENT_DIR)
9
eb38637f338d created cvutils
Nicolas Saunier <nico@confins.net>
parents: 8
diff changeset
8
133
63dd4355b6d1 saving of feature positions in sqlite database
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 129
diff changeset
9 LIBS = -L../../klt -L$(TRAJECTORYMANAGEMENT_DIR)
70
a52653dca25d got track features to compile, updated paths to headers and libraries for OpenCV 2
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 18
diff changeset
10
656
2813d74b3635 explored options for static compilation (failed)
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 655
diff changeset
11 #LDFLAGS = -Wl,-Bstatic -lm
4
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
12 LDFLAGS = -lm
133
63dd4355b6d1 saving of feature positions in sqlite database
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 129
diff changeset
13 LDFLAGS += -lTrajectoryManagementAndAnalysis -lsqlite3
1002
6c5ce3ec497e improved handling of path for feature based tracking
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 996
diff changeset
14 LDFLAGS += -lboost_program_options -lboost_filesystem -lboost_system
70
a52653dca25d got track features to compile, updated paths to headers and libraries for OpenCV 2
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 18
diff changeset
15 #LDFLAGS += -lfltk
4
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
16
653
107f1ad02b69 compilation with C++11 and test function for movingobject distance
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 609
diff changeset
17 CFLAGS = -Wall -W -Wextra -std=c++11
4
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
18 UNAME = $(shell uname)
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
19
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
20 ifneq ($(OPENCV), 0)
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
21 CFLAGS += -DUSE_OPENCV
996
add667153087 updated feature tracker to opencv 3
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 924
diff changeset
22 LDFLAGS += -lopencv_highgui -lopencv_core -lopencv_video -lopencv_features2d -lopencv_imgproc -lopencv_imgcodecs -lopencv_videoio -lopencv_calib3d
4
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
23 endif
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
24
656
2813d74b3635 explored options for static compilation (failed)
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 655
diff changeset
25 #LDFLAGS += -Wl,--as-needed -Wl,-Bdynamic,-lgcc_s,-Bstatic
2813d74b3635 explored options for static compilation (failed)
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 655
diff changeset
26
4
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
27 ifeq ($(UNAME), Linux)
1093
05ccd8ef150c updated to OpenCV4
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 1017
diff changeset
28 INCLUDE+= -I/usr/local/include/opencv4
05ccd8ef150c updated to OpenCV4
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 1017
diff changeset
29 LIBS += -L/usr/local/lib
200
0a27fa343257 added one test and cleaned the first and last instant mess
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 196
diff changeset
30 LINUX_BOOST_PREFIX = /usr/local
4
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
31 CFLAGS += -DLINUX
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
32 EXE_EXTENSION=''
883
5852a3cdd455 added MacOS (Darwin) to Cpp Makefile and moved non-functional CMakeLists.txt
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 806
diff changeset
33 else ifeq ($(UNAME), Darwin)
5852a3cdd455 added MacOS (Darwin) to Cpp Makefile and moved non-functional CMakeLists.txt
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 806
diff changeset
34 OPENCV_HOME=/usr/local
5852a3cdd455 added MacOS (Darwin) to Cpp Makefile and moved non-functional CMakeLists.txt
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 806
diff changeset
35 INCLUDE+= -I$(OPENCV_HOME)/include -I$(OPENCV_HOME)/include/opencv
5852a3cdd455 added MacOS (Darwin) to Cpp Makefile and moved non-functional CMakeLists.txt
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 806
diff changeset
36 LIBS += -L$(OPENCV_HOME)/lib
5852a3cdd455 added MacOS (Darwin) to Cpp Makefile and moved non-functional CMakeLists.txt
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 806
diff changeset
37 LINUX_BOOST_PREFIX = /usr/local
5852a3cdd455 added MacOS (Darwin) to Cpp Makefile and moved non-functional CMakeLists.txt
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 806
diff changeset
38 CFLAGS += -DLINUX
5852a3cdd455 added MacOS (Darwin) to Cpp Makefile and moved non-functional CMakeLists.txt
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 806
diff changeset
39 EXE_EXTENSION=''
4
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
40 else # windows
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
41 MINGW_HOME = 'C:\MinGW'
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
42 LDFLAGS += -mconsole -mwindows -lole32 -lwsock32 -luuid
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
43 EXE_EXTENSION='.exe'
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
44 endif
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
45
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
46 ifeq ($(DEBUG), 1)
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
47 CFLAGS += -g -gstabs+ -DDEBUG
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
48 else
883
5852a3cdd455 added MacOS (Darwin) to Cpp Makefile and moved non-functional CMakeLists.txt
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 806
diff changeset
49 ifeq ($(UNAME), Darwin)
5852a3cdd455 added MacOS (Darwin) to Cpp Makefile and moved non-functional CMakeLists.txt
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 806
diff changeset
50 CFLAGS += -O3
5852a3cdd455 added MacOS (Darwin) to Cpp Makefile and moved non-functional CMakeLists.txt
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 806
diff changeset
51 else
4
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
52 CFLAGS += -O3 --fast-math
883
5852a3cdd455 added MacOS (Darwin) to Cpp Makefile and moved non-functional CMakeLists.txt
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 806
diff changeset
53 endif
4
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
54 CFLAGS += -DNDEBUG
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
55 endif
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
56
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
57 ifeq ($(PROFILING), 1)
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
58 CFLAGS += -pg
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
59 endif
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
60
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
61 CXXFLAGS = $(INCLUDE) $(CFLAGS)
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
62
10
068cf45c3f1b added optical flow skeleton (test to reach a frame with cvqueryframe (fast for small resolutions)
Nicolas Saunier <nico@confins.net>
parents: 9
diff changeset
63 #GUI_OBJS =
655
39fa1c998b29 removed the abstract class to represent folders of images or video files since the capability is now built in OpenCV
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 653
diff changeset
64 CV_OBJS = cvutils.o
196
aeab0b88c9b6 began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 195
diff changeset
65 COMMON_OBJS = utils.o Motion.o Parameters.o utils.o
10
068cf45c3f1b added optical flow skeleton (test to reach a frame with cvqueryframe (fast for small resolutions)
Nicolas Saunier <nico@confins.net>
parents: 9
diff changeset
66 OBJS = $(COMMON_OBJS) $(CV_OBJS)
196
aeab0b88c9b6 began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 195
diff changeset
67 TESTS_OBJS = test_feature.o test_graph.o
162
61fd5aff418c added basics to run tests
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 144
diff changeset
68
10
068cf45c3f1b added optical flow skeleton (test to reach a frame with cvqueryframe (fast for small resolutions)
Nicolas Saunier <nico@confins.net>
parents: 9
diff changeset
69
883
5852a3cdd455 added MacOS (Darwin) to Cpp Makefile and moved non-functional CMakeLists.txt
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 806
diff changeset
70 default: builddir tests feature-based-tracking
4
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
71
883
5852a3cdd455 added MacOS (Darwin) to Cpp Makefile and moved non-functional CMakeLists.txt
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 806
diff changeset
72 optional: test-pixels optical-flow track-features
8
59b7e3954178 renaming and added make clean
Nicolas Saunier <nico@confins.net>
parents: 4
diff changeset
73
59b7e3954178 renaming and added make clean
Nicolas Saunier <nico@confins.net>
parents: 4
diff changeset
74 builddir:
162
61fd5aff418c added basics to run tests
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 144
diff changeset
75 @$(SCRIPTS_DIR)/createdirectory.sh $(EXE_DIR)
4
6509f5b1d795 updated and added makefile to compile C++ code using opencv in its directory, whipped up simple test to read the pixels in BW images
Nicolas Saunier <nico@confins.net>
parents:
diff changeset
76
119
45a426552aaa compilation of very simple feature class with trajectory
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 88
diff changeset
77 test:
45a426552aaa compilation of very simple feature class with trajectory
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 88
diff changeset
78 echo "coucou $(HOME)"
45a426552aaa compilation of very simple feature class with trajectory
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 88
diff changeset
79
162
61fd5aff418c added basics to run tests
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 144
diff changeset
80 tests: $(TESTS_OBJS) $(OBJS)
220
f0f800b95765 switched to Catch for the tests
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 200
diff changeset
81 @$(SCRIPTS_DIR)/createdirectory.sh $(EXE_DIR)
f0f800b95765 switched to Catch for the tests
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 200
diff changeset
82 @$(SCRIPTS_DIR)/createdirectory.sh test_data
162
61fd5aff418c added basics to run tests
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 144
diff changeset
83 $(CXX) $(CFLAGS) $(LIBS) -o $(EXE_DIR)/$@ $^ $(LDFLAGS)
61fd5aff418c added basics to run tests
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 144
diff changeset
84 $(EXE_DIR)/$@
61fd5aff418c added basics to run tests
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 144
diff changeset
85
196
aeab0b88c9b6 began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 195
diff changeset
86 feature-based-tracking: feature-based-tracking.o $(OBJS)
415
27f14b99f5a8 added creation of bin directory
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 401
diff changeset
87 @$(SCRIPTS_DIR)/createdirectory.sh $(EXE_DIR)
162
61fd5aff418c added basics to run tests
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 144
diff changeset
88 $(CXX) $(CFLAGS) $(LIBS) $^ -o $(EXE_DIR)/$@ $(LDFLAGS)
119
45a426552aaa compilation of very simple feature class with trajectory
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 88
diff changeset
89
18
ef35d5f111e4 incorporated code to use KLT
Nicolas Saunier <nico@confins.net>
parents: 13
diff changeset
90 track-features.o: track-features.cpp
ef35d5f111e4 incorporated code to use KLT
Nicolas Saunier <nico@confins.net>
parents: 13
diff changeset
91 $(CXX) -I../../klt $(INCLUDE) $^ -c
ef35d5f111e4 incorporated code to use KLT
Nicolas Saunier <nico@confins.net>
parents: 13
diff changeset
92
ef35d5f111e4 incorporated code to use KLT
Nicolas Saunier <nico@confins.net>
parents: 13
diff changeset
93 track-features: track-features.o $(OBJS)
162
61fd5aff418c added basics to run tests
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 144
diff changeset
94 $(CXX) $(CFLAGS) $(LIBS) -L../../klt $^ -o $(EXE_DIR)/$@ $(LDFLAGS) -lklt
18
ef35d5f111e4 incorporated code to use KLT
Nicolas Saunier <nico@confins.net>
parents: 13
diff changeset
95
10
068cf45c3f1b added optical flow skeleton (test to reach a frame with cvqueryframe (fast for small resolutions)
Nicolas Saunier <nico@confins.net>
parents: 9
diff changeset
96 optical-flow: optical-flow.o $(OBJS)
162
61fd5aff418c added basics to run tests
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 144
diff changeset
97 $(CXX) $(CFLAGS) $(LIBS) $^ -o $(EXE_DIR)/$@ $(LDFLAGS)
10
068cf45c3f1b added optical flow skeleton (test to reach a frame with cvqueryframe (fast for small resolutions)
Nicolas Saunier <nico@confins.net>
parents: 9
diff changeset
98
068cf45c3f1b added optical flow skeleton (test to reach a frame with cvqueryframe (fast for small resolutions)
Nicolas Saunier <nico@confins.net>
parents: 9
diff changeset
99 test-pixels: test-pixels.o $(OBJS)
162
61fd5aff418c added basics to run tests
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 144
diff changeset
100 $(CXX) $(CFLAGS) $(LIBS) $^ -o $(EXE_DIR)/$@ $(LDFLAGS)
8
59b7e3954178 renaming and added make clean
Nicolas Saunier <nico@confins.net>
parents: 4
diff changeset
101
59b7e3954178 renaming and added make clean
Nicolas Saunier <nico@confins.net>
parents: 4
diff changeset
102 clean:
162
61fd5aff418c added basics to run tests
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 144
diff changeset
103 rm -f *.gch */*.o *.o *.a $(EXE_DIR)/*
8
59b7e3954178 renaming and added make clean
Nicolas Saunier <nico@confins.net>
parents: 4
diff changeset
104 # $(DISTFILE_OUTPUT)