日期:2014-05-16 浏览次数:20796 次
CC = g++
OBJ = user.o app.o
#vpath %.h /include
#vpath %.c /src
VPATH=/src:/include
app:$(OBJ)
    $(CC) -o app $(OBJ)
user.o:user.c
    $(CC) -c user.c
app.o:app.c  user.h
    $(CC) -c app.c
clean:
    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();    
}