b074@gliethttp:~/work/gunzip$ cat Makefile
CC = gcc-4.1
LD = gcc-4.1
CFLAGS = -Wall -c -Dgliethttp -I.
LDFLAGS = -lpthread
SRCS = $(wildcard *.c)
OBJS = $(patsubst %c,%o,$(SRCS))
TARGET = gliethttp
.PHONY: all clean
all: $(TARGET)
$(TARGET): $(OBJS)
$(LD) $(LDFLAGS) -o $@ $^
%o: %c
$(CC) $(CFLAGS) -o $@ $<
clean:
@rm -f *.o $(TARGET)
编译当前Makefile所在目录下的所有.c文件
执行
make
make clean
阅读(1515) | 评论(0) | 转发(0) |