一个Makefile

CC = g++
CCFLAGS = -O3 -DNDEBUG

INC = -I ../../include

SRC = $(wildcard *.cpp)
OBJ = $(patsubst %.cpp,%.o, $(SRC))

.PHONY: all clean

all: $(OBJ) lib

.cpp.o:
    $(CC) $(CCFLAGS) -c -o $@ $< $(INC)

lib:
    ar rcs libbob.a *.o

clean:
    rm -rf libbob.a *.o
posted @ 2016-01-07 19:45  qwertWZ  阅读(286)  评论(0编辑  收藏  举报