view c/Makefile @ 8:59b7e3954178

renaming and added make clean
author Nicolas Saunier <nico@confins.net>
date Sat, 07 Nov 2009 23:33:51 -0500
parents 6509f5b1d795
children eb38637f338d
line wrap: on
line source

BUILD_DIR=../bin

CXX = g++

LDFLAGS = -lm
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 += -lhighgui -lcxcore -lcv -lml
endif

ifeq ($(UNAME), Linux)
	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)

default: all builddir

all: test-pixels

builddir:
	@createdirectory.sh $(BUILD_DIR)

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

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