diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2008-07-01 09:15:48 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2008-07-01 09:15:48 +0000 |
commit | 2ceb4d9fc2e577d8c7b5f37a14932e811f50d921 (patch) | |
tree | 211f840b30edbe734ff172fce5edb32d0bcac59f | |
parent | fb85119f6c7bb384daa57c091064aec3a064f7f2 (diff) |
cleaned up makefile in prep to building on Windows. Builds on Mac OS X, next to test GNU/Linux
svn path=/trunk/externals/pix_opencv/; revision=10126
-rw-r--r-- | Makefile | 71 |
1 files changed, 26 insertions, 45 deletions
@@ -1,66 +1,56 @@ PD_DIR = ../../pd GEM_DIR = ../../Gem -OPENCV_DIR = opencv-1.0.0 -LIBS = -lm $(OPENCV_DIR)/build/cv/src/.libs/lib_cv.a GEM_OPENCV_VERSION = 0.1 # build flags -GEM_OPENCV_INCLUDE = -I$(PD_DIR)/src -I. -I$(GEM_DIR)/src -I$(PD_DIR)/src \ - -I$(OPENCV_DIR)/cv/include -I$(OPENCV_DIR)/cxcore/include -GEM_OPENCV_CPPFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -ffast-math \ +INCLUDES = -I$(PD_DIR)/src -I. -I$(GEM_DIR)/src -I$(PD_DIR)/src +CPPFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -ffast-math \ -Wall -W -Wno-unused -Wno-parentheses -Wno-switch \ -DGEM_OPENCV_VERSION=\"$(GEM_OPENCV_VERSION)\" -g UNAME := $(shell uname -s) ifeq ($(UNAME),Linux) + INCLUDES += `pkg-config --cflags opencv` LDFLAGS = -export_dynamic -shared + LIBS = `pkg-config --libs opencv` EXTENSION = pd_linux endif ifeq ($(UNAME),Darwin) + OPENCV_DIR = opencv-1.0.0 + INCLUDES += -I$(OPENCV_DIR)/cv/include -I$(OPENCV_DIR)/cxcore/include LDFLAGS = -bundle -undefined dynamic_lookup + LIBS = -lm $(OPENCV_DIR)/build/cv/src/.libs/lib_cv.a EXTENSION = pd_darwin endif +ifeq (MINGW,$(findstring MINGW,$(UNAME))) + OPENCV_DIR = opencv-1.0.0 + INCLUDES += -I$(OPENCV_DIR)/cv/include -I$(OPENCV_DIR)/cxcore/include + CPPFLAGS += -mms-bitfields -DMSW -DNT $(WINDOWS_HACKS) + LDFLAGS += -shared + LIBS = -L$(pd_src)/bin -L$(pd_src)/obj -lpd -lkernel32 -luser32 -lgdi32 \ + -lm $(OPENCV_DIR)/build/cv/src/.libs/lib_cv.a +endif -all: pix_opencv_edge.$(EXTENSION) pix_opencv_laplace.$(EXTENSION) pix_opencv_morphology.$(EXTENSION) pix_opencv_distrans.$(EXTENSION) pix_opencv_motempl.$(EXTENSION) pix_opencv_haarcascade.$(EXTENSION) pix_opencv_contours_boundingrect.$(EXTENSION) pix_opencv_bgsubstract.$(EXTENSION) pix_opencv_contours_convexity.$(EXTENSION) - -pix_opencv_contours_convexity.$(EXTENSION): pix_opencv_contours_convexity.o - rm -f pix_opencv_contours_convexity.$(EXTENSION) - gcc $(LDFLAGS) -o pix_opencv_contours_convexity.$(EXTENSION) pix_opencv_contours_convexity.o $(LIBS) `pkg-config --libs opencv` - -pix_opencv_contours_boundingrect.$(EXTENSION): pix_opencv_contours_boundingrect.o - rm -f pix_opencv_contours_boundingrect.$(EXTENSION) - gcc $(LDFLAGS) -o pix_opencv_contours_boundingrect.$(EXTENSION) pix_opencv_contours_boundingrect.o $(LIBS) `pkg-config --libs opencv` - -pix_opencv_haarcascade.$(EXTENSION): pix_opencv_haarcascade.o - rm -f pix_opencv_haarcascade.$(EXTENSION) - gcc $(LDFLAGS) -o pix_opencv_haarcascade.$(EXTENSION) pix_opencv_haarcascade.o $(LIBS) `pkg-config --libs opencv` +.SUFFIXES = $(EXTENSION) -pix_opencv_motempl.$(EXTENSION): pix_opencv_motempl.o - rm -f pix_opencv_motempl.$(EXTENSION) - gcc $(LDFLAGS) -o pix_opencv_motempl.$(EXTENSION) pix_opencv_motempl.o $(LIBS) `pkg-config --libs opencv` +SOURCES = pix_opencv_edge.cc pix_opencv_laplace.cc pix_opencv_morphology.cc pix_opencv_distrans.cc pix_opencv_motempl.cc pix_opencv_haarcascade.cc pix_opencv_contours_boundingrect.cc pix_opencv_bgsubstract.cc pix_opencv_contours_convexity.cc -pix_opencv_distrans.$(EXTENSION): pix_opencv_distrans.o - rm -f pix_opencv_distrans.$(EXTENSION) - gcc $(LDFLAGS) -o pix_opencv_distrans.$(EXTENSION) pix_opencv_distrans.o $(LIBS) `pkg-config --libs opencv` +all: $(SOURCES:.cc=.$(EXTENSION)) -pix_opencv_morphology.$(EXTENSION): pix_opencv_morphology.o - rm -f pix_opencv_morphology.$(EXTENSION) - gcc $(LDFLAGS) -o pix_opencv_morphology.$(EXTENSION) pix_opencv_morphology.o $(LIBS) `pkg-config --libs opencv` +%.$(EXTENSION): %.o + gcc $(LDFLAGS) -o $*.$(EXTENSION) $*.o $(LIBS) -pix_opencv_laplace.$(EXTENSION): pix_opencv_laplace.o - rm -f pix_opencv_laplace.$(EXTENSION) - gcc $(LDFLAGS) -o pix_opencv_laplace.$(EXTENSION) pix_opencv_laplace.o $(LIBS) `pkg-config --libs opencv` +.cc.o: + g++ $(CPPFLAGS) $(INCLUDES) -o $*.o -c $*.cc -pix_opencv_edge.$(EXTENSION): pix_opencv_edge.o - rm -f pix_opencv_edge.$(EXTENSION) - gcc $(LDFLAGS) -o pix_opencv_edge.$(EXTENSION) pix_opencv_edge.o $(LIBS) `pkg-config --libs opencv` +.c.o: + gcc $(CPPFLAGS) $(INCLUDES) -o $*.o -c $*.c -pix_opencv_bgsubstract.$(EXTENSION): pix_opencv_bgsubstract.o - rm -f pix_opencv_bgsubstract.$(EXTENSION) - gcc $(LDFLAGS) -o pix_opencv_bgsubstract.$(EXTENSION) pix_opencv_bgsubstract.o $(LIBS) `pkg-config --libs opencv` +install: + cp -f --remove-destination *.pd $(PD_DIR)/doc/5.reference clean: rm -f pix_opencv*.o @@ -68,12 +58,3 @@ clean: distro: clean all rm *.o - -.cc.o: - g++ $(GEM_OPENCV_CPPFLAGS) $(GEM_OPENCV_INCLUDE) `pkg-config --cflags opencv` -o $*.o -c $*.cc - -.c.o: - gcc $(GEM_OPENCV_CPPFLAGS) $(GEM_OPENCV_INCLUDE) -o $*.o -c $*.c - -install: - cp -f --remove-destination *.pd $(PD_DIR)/doc/5.reference |