# makefile for assignment 1 CC = gcc CFLAGS = -Wall -g COMPILE = $(CC) $(CFLAGS) -c SRCS := $(wildcard *.c) OBJS := $(patsubst %.c,%.o,$(SRCS)) # make an executable for each of the test programs and for that in part 10 as well READBLOCK1_OBJS := readblock.o readblock_test1.o READBLOCK2_OBJS := readblock.o readblock_test2.o READ_TERMINATOR_OBJS := readblock.o read_terminator.o EXECUTABLES = rt.out all: $(EXECUTABLES) a2.out: $(READBLOCK2_OBJS) $(CC) $(CFLAGS) -o $@ $(READBLOCK2_OBJS) a1.out: $(READBLOCK1_OBJS) $(CC) $(CFLAGS) -o $@ $(READBLOCK1_OBJS) rt.out: $(READ_TERMINATOR_OBJS) $(CC) $(CFLAGS) -o $@ $(READ_TERMINATOR_OBJS) %.o: %.c $(COMPILE) -o $@ $< clean: -rm $(OBJS) $(EXECUTABLES) explain: @echo "The following information represents all the programs for assignment one:" @echo "programs: $(EXECUTABLES)" @echo "Object files a.out: $(READBLOCK1_OBJS)"