view c/Makefile @ 133:63dd4355b6d1

saving of feature positions in sqlite database
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Wed, 17 Aug 2011 22:26:01 -0400
parents 4742b2b6d851
children 0f790de9437e
line wrap: on
line source

BUILD_DIR=../bin
SCRIPTS_DIR=../scripts
TRAJECTORYMANAGEMENT_DIR=$(HOME)/Research/Code/trajectorymanagementandanalysis/trunk/src/TrajectoryManagementAndAnalysis

CXX = g++

INCLUDE = -I../include -I$(TRAJECTORYMANAGEMENT_DIR)

LIBS = -L../../klt -L$(TRAJECTORYMANAGEMENT_DIR)

LDFLAGS = -lm
LDFLAGS += -lTrajectoryManagementAndAnalysis -lsqlite3
#LDFLAGS += -lboost_program_options-mt -lboost_filesystem-mt -lboost_system-mt -lboost_unit_test_framework-mt
#LDFLAGS += -lfltk

CFLAGS = -Wall -W -Wextra
# -DUSE_OPENCV
UNAME = $(shell uname)

ifneq ($(OPENCV), 0)
	CFLAGS += -DUSE_OPENCV
	LDFLAGS += -lopencv_highgui -lopencv_core -lopencv_video -lopencv_ml -lopencv_features2d
endif

ifeq ($(UNAME), Linux)
	OPENCV_HOME=/usr/local
	INCLUDE+= -I$(OPENCV_HOME)/include -I$(OPENCV_HOME)/include/opencv
	LIBS += -L$(OPENCV_HOME)/lib
	LINUX_BOOST_PREFIX = /usr/local
	CFLAGS += -DLINUX
	EXE_EXTENSION=''
else # windows
	MINGW_HOME = 'C:\MinGW'
	LDFLAGS += -mconsole -mwindows -lole32 -lwsock32 -luuid
	EXE_EXTENSION='.exe'
endif

ifeq ($(DEBUG), 1)
	CFLAGS += -g -gstabs+ -DDEBUG
else
	CFLAGS += -O3 --fast-math
	CFLAGS += -DNDEBUG
endif

ifeq ($(PROFILING), 1)
	CFLAGS += -pg
endif

CXXFLAGS = $(INCLUDE) $(CFLAGS)

#GUI_OBJS = 
CV_OBJS = cvutils.o
COMMON_OBJS = utils.o
OBJS = $(COMMON_OBJS) $(CV_OBJS)
#TESTS_OBJS = 

default: builddir all

all: test-pixels optical-flow track-features

builddir:
	@$(SCRIPTS_DIR)/createdirectory.sh $(BUILD_DIR)

test:
	echo "coucou $(HOME)"

feature-based-tracking: feature-based-tracking.o cvutils.o Feature.o
	$(CXX) $(CFLAGS) $(LIBS) $^ -o $(BUILD_DIR)/$@ $(LDFLAGS)

track-features.o: track-features.cpp
	$(CXX) -I../../klt $(INCLUDE) $^ -c

track-features: track-features.o $(OBJS)
	$(CXX) $(CFLAGS) $(LIBS) -L../../klt $^ -o $(BUILD_DIR)/$@ $(LDFLAGS) -lklt

optical-flow: optical-flow.o $(OBJS)
	$(CXX) $(CFLAGS) $(LIBS) $^ -o $(BUILD_DIR)/$@ $(LDFLAGS)

test-pixels: test-pixels.o $(OBJS)
	$(CXX) $(CFLAGS) $(LIBS) $^ -o $(BUILD_DIR)/$@ $(LDFLAGS)

clean:
	rm -f *.gch */*.o *.o *.a  $(BUILD_DIR)/*
# $(DISTFILE_OUTPUT)