CXX = clang++
CXXFLAGS = -std=c++23 -Wall -Wextra -O2

task-1/build/app: task-1/main.cpp task-1/queue.hpp task-1/workers.hpp
	@$(CXX) $(CXXFLAGS) task-1/main.cpp -o task-1/build/app

task-1: task-1/build/app
	@./task-1/build/app

task-2/build/app: task-2/main.cpp task-2/vector.hpp task-2/workers.hpp
	@$(CXX) $(CXXFLAGS) task-2/main.cpp -o task-2/build/app

task-2: task-2/build/app
	@./task-2/build/app

task-3/build/app: task-3/main.cpp task-3/forks.hpp task-3/workers.hpp
	@$(CXX) $(CXXFLAGS) task-3/main.cpp -o task-3/build/app

task-3: task-3/build/app
	@./task-3/build/app

launcher/build/app: launcher/main.cpp launcher/queue.hpp launcher/workers.hpp
	@$(CXX) $(CXXFLAGS) launcher/main.cpp -o launcher/build/app

launcher/build/launcher: launcher/launcher.cpp
	@$(CXX) $(CXXFLAGS) launcher/launcher.cpp -o launcher/build/launcher

launcher: launcher/build/app launcher/build/launcher
	@./launcher/build/launcher

launcher-app: launcher/build/app
	@./launcher/build/app

clean:
	@find . -mindepth 2 -type d -name build -exec find {} -type f -delete \;
