makefile 多路径下编译失败
错误提示:
make: *** No rule to make target `user.c', needed by `user.o'. Stop.
请问如何才能实现多目录的编译??请指教一下,谢谢!!!
文件结构
E:.
│ makefile
│ makefile.bak
│ 新建 Microsoft Word 文档.doc
│
├─include
│ user.h
│ user.h.bak
│
└─src
app.c
app.c.bak
user.c
user.c.bak
makefile脚本
CC = g++OBJ = user.o app.o#vpath %.h /include#vpath %.c /srcVPATH=/src:/includeapp:$(OBJ) $(CC) -o app $(OBJ)user.o:user.c $(CC) -c user.capp.o:app.c user.h $(CC) -c app.cclean: rm *.o app
//user.h#include <stdio.h>void PrintHello();
//user.c#include "user.h"void PrintHello(){ printf("hello ,it is my makefile test\n");}//app.c#include "user.h"int main(){ PrintHello(); }