#obj=main.o add.o sub.o mul.o
target=app
#makefile中自己维护的变量
#mkaefile中的函数的使用
src=$(wildcard ./*.c)
obj=$(patsubst ./%.c, ./%.o, $(src))
CC = gcc
CPPFLAGS = -I
$(target):$(obj)
$(CC) $(obj) -o $(target)
%.o:%.c
$(CC) -c $< -o $@
.PHONY:clean
clean:
#-mkdir /aa
rm -f $(obj) $(target)
makefile示例
最新推荐文章于 2024-06-01 20:19:52 发布