更新Makefile
CFLAGS=-Wall
cc= gcc
cflag= -Wall -g
allfiles= ex1.c ex2.c ex3.c ex4.c ex5.c ex4-1.c
objs = $(allfiles:.c=.o)
execs = $(patsubst %.c,%,$(allfiles))
m:
vim Makefile
all: $(execs)
$(execs): $(objs)
$(cc) $(cflag) $@.o -o $@
$(objs): $(allfiles)
$(cc) $(cflag) -c $^
cln:
rm -f $(execs) $(objs)
c:
clear
附加题
1.我的前置文件是所有的ex,所以都编译了一遍
2.