PROBLEMS = $(wildcard tasks/*.mat) RESULTS = $(PROBLEMS:tasks/%=results/%) calculate: problems solutions solutions: results $(RESULTS) results: @mkdir results problems: tasks problems_prepared.stamp tasks: @mkdir tasks problems_prepared.stamp: tasks_builder.m @rm -f tasks/* @./tasks_builder.m @touch $@ @echo "Please run again: make calculate" $(RESULTS): results/% : tasks/% ./task_solver.m $< $@ tasks_clean: rm -rf tasks/* results_clean: rm -rf results/* clean: tasks_clean results_clean rm -f problems_prepared.stamp real_clean: clean rm -rf tasks rm -rf results rm -rf L0m.cache