src = $(wildcard ./*.c) obj = $(patsubst %.c, %.o, $(src)) target=t $(target):$(obj) gcc $^ -o $@ %.o:%.c gcc -c $< -o $@.PHONY:clean clean: rm *.o $(target) -f
makefile
原文:https://www.cnblogs.com/libing029/p/10936720.html