# Makefile template from CS 270 PROGRAM = testPrint # name of executable HEADERS = printnum.h SRCS = printnum.c testPrint.c OBJS = $(patsubst %.c, %.o, $(SRCS)) # Compiler and loader commands and flags CC = gcc CC_FLAGS = -g -std=c11 -Wall # Compile .c files to .o files .c.o: $(CC) -c $(CC_FLAGS) $< # default is the executable - always first default: $(PROGRAM) $(PROGRAM): $(OBJS) $(CC) $(CC_FLAGS) $(OBJS) -o $(PROGRAM) # Recompile C objects if headers change ${OBJS}: ${HEADERS} # Clean up the directory clean: rm -f *.o *~ $(PROGRAM)