Mercurial > hg > nsaunier > traffic-intelligence
annotate c/Makefile @ 9:eb38637f338d
created cvutils
| author | Nicolas Saunier <nico@confins.net> |
|---|---|
| date | Sun, 08 Nov 2009 10:33:41 -0500 |
| parents | 59b7e3954178 |
| children | 068cf45c3f1b |
| rev | line source |
|---|---|
|
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
|
1 BUILD_DIR=../bin |
|
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
|
2 |
|
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
|
3 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
|
4 |
| 9 | 5 INCLUDE = -I../include |
| 6 | |
|
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
|
7 LDFLAGS = -lm |
|
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
|
8 LDFLAGS += -lboost_program_options-mt -lboost_filesystem-mt -lboost_system-mt -lboost_unit_test_framework-mt |
|
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
|
9 LDFLAGS += -lfltk |
|
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
|
10 |
|
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
|
11 CFLAGS = -Wall -W -Wextra |
|
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 # -DUSE_OPENCV |
|
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
|
13 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
|
14 |
|
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
|
15 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
|
16 CFLAGS += -DUSE_OPENCV |
|
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
|
17 LDFLAGS += -lhighgui -lcxcore -lcv -lml |
|
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 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
|
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 ifeq ($(UNAME), Linux) |
|
8
59b7e3954178
renaming and added make clean
Nicolas Saunier <nico@confins.net>
parents:
4
diff
changeset
|
21 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
|
22 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
|
23 EXE_EXTENSION='' |
|
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 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
|
25 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
|
26 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
|
27 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
|
28 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
|
29 |
|
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
|
30 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
|
31 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
|
32 else |
|
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
|
33 CFLAGS += -O3 --fast-math |
|
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
|
34 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
|
35 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
|
36 |
|
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
|
37 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
|
38 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
|
39 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
|
40 |
|
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 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
|
42 |
|
8
59b7e3954178
renaming and added make clean
Nicolas Saunier <nico@confins.net>
parents:
4
diff
changeset
|
43 default: all builddir |
|
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
|
44 |
|
8
59b7e3954178
renaming and added make clean
Nicolas Saunier <nico@confins.net>
parents:
4
diff
changeset
|
45 all: test-pixels |
|
59b7e3954178
renaming and added make clean
Nicolas Saunier <nico@confins.net>
parents:
4
diff
changeset
|
46 |
|
59b7e3954178
renaming and added make clean
Nicolas Saunier <nico@confins.net>
parents:
4
diff
changeset
|
47 builddir: |
|
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
|
48 @createdirectory.sh $(BUILD_DIR) |
|
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
|
49 |
| 9 | 50 test-pixels: test-pixels.o cvutils.o |
|
8
59b7e3954178
renaming and added make clean
Nicolas Saunier <nico@confins.net>
parents:
4
diff
changeset
|
51 $(CXX) $(CFLAGS) $(LIBS) $^ -o $(BUILD_DIR)/test-pixels $(LDFLAGS) |
|
59b7e3954178
renaming and added make clean
Nicolas Saunier <nico@confins.net>
parents:
4
diff
changeset
|
52 # $(CXX) $(CFLAGS) $(LIBS) $^ -o $(BUILD_DIR)/$@ $(LDFLAGS) |
|
59b7e3954178
renaming and added make clean
Nicolas Saunier <nico@confins.net>
parents:
4
diff
changeset
|
53 |
|
59b7e3954178
renaming and added make clean
Nicolas Saunier <nico@confins.net>
parents:
4
diff
changeset
|
54 clean: |
|
59b7e3954178
renaming and added make clean
Nicolas Saunier <nico@confins.net>
parents:
4
diff
changeset
|
55 rm -f *.gch */*.o *.o *.a $(BUILD_DIR)/* |
|
59b7e3954178
renaming and added make clean
Nicolas Saunier <nico@confins.net>
parents:
4
diff
changeset
|
56 # $(DISTFILE_OUTPUT) |
