问一个makefile 的问题
目前想在linux 下使用opencv 写个小程序,参考例子写了个makefile文件,如下:
INCLUDE = $(shell pkg-config --cflags opencv)
LIBS = $(shell pkg-config --libs opencv)
OBJECTS = test1.o main.o
SOURCE_H = common.h test1.h
SOURCE_C = test1.cpp main.cpp
CC = g++
CFLAGS = -c
TARGET = test1
$(OBJECTS) : $(SOURCE)
$(CC) $(CFLAGS) $(SOURCE)
$(TARGET):$(OBJECTS)
$(CC) -o $(TARGET) $(OBJECTS) -I $(INCLUDE) $(LIBS)
clean:
rm -f $(OBJECTS) $(TARGET)
但是执行make命令编译的时候报错,提示如下:
g++ -c
g++: fatal error: no input files
compilation terminated.
makefile:12: recipe for target 'test1.o' failed
这是为什么?错在哪里?要如何改正?
谢谢!