【文件属性】:
文件名称:makefile的写法makefile的写法
文件大小:3KB
文件格式:TXT
更新时间:2014-02-07 19:20:29
makefile的写法makefile的写法makefile的写法
我们首先看一个简单的makefile:
CC = g++
OBJS = main.o base.o derive.o
EXEC = test
$(EXEC): $(OBJS)
$(CC) -o $@ $^
main.o: main.cpp base.h derive.h
$(CC) -c $<
base.o: base.cpp base.h
$(CC) -c $<
derive.o: derive.cpp derive.h base.h
$(CC) -c $<
clean:
rm -rf $(EXEC) *.o
CC = g++
OBJS = main.o base.o derive.o
EXEC = test
$(EXEC): $(OBJS)
$(CC) -o $@ $^
main.o: main.cpp base.h derive.h
$(CC) -c $<