制定目标没有规则***

时间:2013-07-22 21:14:30

标签: c++ makefile mingw target

我目前正试图在我的Windows 7 x64中使用“make”构建Face Tracker(由Jason Saragih制作),但我得到的是:“没有规则来制作目标src / lib / IO.o,需要斌/ face_tracker”。

有人知道发生了什么吗?

这是makefile(也可以在Jason Saragih的页面中找到):

# Paths
OPENCV_PATH=/OpenCV246/

# Programs
CC=
CXX=g++

# Flags
ARCH_FLAGS=-arch x86_64
CFLAGS=-Wextra -Wall -pedantic-errors $(ARCH_FLAGS) -O3
LDFLAGS=$(ARCH_FLAGS)
DEFINES=
INCLUDES=-I$(OPENCV_PATH)/include -Iinclude/
LIBRARIES=-L$(OPENCV_PATH)/lib -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_objdetect

# Files which require compiling
SOURCE_FILES=\
    src/lib/IO.cc\
    src/lib/PDM.cc\
    src/lib/Patch.cc\
    src/lib/CLM.cc\
    src/lib/FDet.cc\
    src/lib/PAW.cc\
    src/lib/FCheck.cc\
    src/lib/Tracker.cc

# Source files which contain a int main(..) function
SOURCE_FILES_WITH_MAIN=src/exe/face_tracker.cc

# End Configuration
SOURCE_OBJECTS=$(patsubst %.cc,%.o,$(SOURCE_FILES))

ALL_OBJECTS=\
    $(SOURCE_OBJECTS) \
    $(patsubst %.cc,%.o,$(SOURCE_FILES_WITH_MAIN))

DEPENDENCY_FILES=\
    $(patsubst %.o,%.d,$(ALL_OBJECTS)) 

all: bin/face_tracker

%.o: %.cc Makefile
    @# Make dependecy file
    $(CXX) -MM -MT $@ -MF $(patsubst %.cc,%.d,$<) $(CFLAGS) $(DEFINES) $(INCLUDES) $<
    @# Compile
    $(CXX) $(CFLAGS) $(DEFINES) $(INCLUDES) -c -o $@ $< 

-include $(DEPENDENCY_FILES)

bin/face_tracker: $(ALL_OBJECTS)
    $(CXX) $(LDFLAGS) $(LIBRARIES) -o $@ $(ALL_OBJECTS)

.PHONY: clean
clean:
    @echo "Cleaning"
    @for pattern in '*~' '*.o' '*.d' ; do \
        find . -name "$$pattern" | xargs rm ; \
    done

谢谢, 法比奥

0 个答案:

没有答案