万能makefile

TARGET = tset 

 #可执行文件名字 

CC = gcc
PWD := $(shell pwd)


INCLUDE_DIR = $(PWD)


SOURCE_DIR = $(PWD)




CFLAGS = -w -g -I $(INCLUDE_DIR) -DTEST_LW





  #编译该路径下所有的.c文件
ALL_SRCS = $(SOURCE_DIR)/*.c 




all: $(TARGET)


$(TARGET): 
$(CC)  $(CFLAGS) $(ALL_SRCS) -o $(TARGET) 


clean:
rm -f *.o  *~ $(TARGET)


.PHONY: clean

你可能感兴趣的:(万能makefile)