# Define how many batches you want to generate
N := 32

# Generate the list of target files
BATCH_RESULTS := $(foreach n,$(shell seq 1 $(N)),batch$(n).res)

# Main target
all: results.csv plot.pdf

plot.pdf: results.csv
	python3 plot.py $^

results.csv: $(BATCH_RESULTS)
	python3 merge.py $^ > $@

# Pattern rule to generate each batch result
batch%.res: sim.q ../modello.xml
	/opt/uppaal/lib/app/bin/verifyta --seed $$(echo "$@" | cksum | cut -d' ' -f1) ../modello.xml sim.q > $@

# Clean rule
clean:
	rm -f $(BATCH_RESULTS) results.csv plot.pdf

.PHONY: all clean
