# Makefile, generated with support of ChatGPT # Compiler and flags CXX = g++ CXXFLAGS = -Wall -std=c++17 # Source files COMMON_SRCS = Support/Common.cpp LAB0_SRCS = LabZero.cpp lab0.cpp $(COMMON_SRCS) LAB1_SRCS = LabOne.cpp lab1.cpp $(COMMON_SRCS) # Object files COMM_OBJS = Support/Common.o LAB0_OBJS = LabZero.o lab0.o $(COMM_OBJS) LAB1_OBJS = LabOne.o lab1.o $(COMM_OBJS) OBJS = $(COMM_OBJS) $(LAB0_OBJS) $(LAB1_OBJS) # Executable names LAB0_EXEC = lab0 LAB1_EXEC = lab1 EXEC = $(LAB0_EXEC) $(LAB1_EXEC) # Default target to build the executable all: $(LAB0_EXEC) $(LAB1_EXEC) # Rule to build the executable from object files $(LAB0_EXEC): $(LAB0_OBJS) Makefile $(CXX) $(CXXFLAGS) -o $(LAB0_EXEC) $(LAB0_OBJS) ./$(LAB0_EXEC) $(LAB1_EXEC): $(LAB1_OBJS) Makefile $(CXX) $(CXXFLAGS) -o $(LAB1_EXEC) $(LAB1_OBJS) ./$(LAB1_EXEC) # Rules to build object files from source files, with dependency on the Common.h header %.o: %.cpp Support/Common.h Makefile $(CXX) $(CXXFLAGS) -c $< -o $@ $(SUPPORT_DIR)/Common.o: Support/Common.cpp Support/Common.h $(CXX) $(CXXFLAGS) -c $(SUPPORT_DIR)/Common.cpp # Clean target to remove compiled files clean: rm -f $(OBJS) $(EXEC)