# Makefile-5 # # Introduces phony targets # # C_OBJS = main.o hello.o world.o C_HEADERS = hello.h world.h EXE = R5 CC = gcc CC_FLAGS = -std=c11 -g -Wall -c LD_FLAGS = -std=c11 -g -Wall ################################################################################ # Linking step R5: $(C_OBJS) $(CC) $(LD_FLAGS) $(C_OBJS) -o $(EXE) # Recompiles everything if headers change $(C_OBJS): $(C_HEADERS) # Compiling step %.o: %.c $(CC) $(CC_FLAGS) $< # Clean the directory in order to later build from scratch clean: rm -rf *.o $(EXE)