diff --git a/Makefile b/Makefile index 323563f..e7fab1f 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,11 @@ +MAKEFILE # Define the compiler and compiler flags CXX := g++ CXXFLAGS := -std=c++17 -Wall -g # Define the names for the executable, source files, and object files TARGET := main -SOURCES := person.cpp utils.cpp main.cpp +SOURCES := person.cpp utils.cpp main.cpp stacks/expressions_calculator.cpp OBJECTS := $(SOURCES:.cpp=.o) # Default rule to build the executable @@ -15,17 +16,17 @@ $(TARGET): $(OBJECTS) $(CXX) $(CXXFLAGS) -o $@ $(OBJECTS) # Generic rule to compile .cpp files into .o files -# $@ is the target, $< is the first prerequisite %.o: %.cpp $(CXX) $(CXXFLAGS) -c $< -o $@ # Rules for explicit header dependencies -# These rules tell make which object files depend on which header files. -main.o: main.cpp person.h utils.h +main.o: main.cpp person.h utils.h stacks/expressions_calculator.h person.o: person.cpp person.h utils.o: utils.cpp utils.h +stacks/expressions_calculator.o: stacks/expressions_calculator.cpp stacks/expressions_calculator.h # Rule to clean up generated files -.PHONY: clean +.PHONY: cleanls + clean: rm -f $(OBJECTS) $(TARGET)