首页 > 代码库 > OpenCV 多文件编译的Makefile编写

OpenCV 多文件编译的Makefile编写

Demo Makefile for OpenCV



这里给出OpenCV的makefile的demo

遇到一个坑 ‘ is not `

呵呵...


之前写的makefile会遇到这样的报错



郁闷了好久...

特别注意`*****`

*旁边的符号不是单引号,而是键盘Esc下面的那个键!


demo makefile:

SOURCE_FILE:= get_semi_win.c semi_inverse_dehazing.c

OBJECT_FILE:= get_semi_win.o semi_inverse_dehazing.o

CFLAGS = -Wall -Wconversion -O3 `pkg-config --cflags opencv`

LIBS = `pkg-config --libs opencv`

complie:
	gcc $(CFLAGS) -c $(SOURCE_FILE) $(LIBS)
link:
	gcc $(CFLAGS) $(OBJECT_FILE) -o ./a.out $(LIBS)

clean:
	rm -rf ./*.o ./a.out




好的设计模式,让你的模块更加健壮.



OpenCV 多文件编译的Makefile编写