include ../common.mk

foreach_base = $(subst BASE,00base,$(1)) \
               $(subst BASE,01mlx,$(1)) \
               $(subst BASE,02mmsg,$(1)) \
               $(subst BASE,03defer,$(1)) \
               $(subst BASE,04reuse,$(1))

IMGS_BIG = $(call foreach_base,graph.big/BASE-bw.pdf)
DATS_BIG = $(call foreach_base,graph.big/BASE.dat)

IMGS_SMALL = graph.small/04reuse-bw.pdf
DATS_SMALL = $(call foreach_base,graph.small/BASE.dat)

IMGS_AUDIT = graph.audit/04reuse-bw.pdf \
             graph.audit/04reuse-bw-zoom.pdf
DATS_AUDIT = $(call foreach_base,graph.audit/BASE.dat) \
             $(call foreach_base,graph.audit/BASE-sysvmq.dat)

GENERATED = $(IMGS_BIG) $(IMGS_SMALL) $(IMGS_AUDIT)

$(IMGS_BIG): graph.big/plot.plt common.plt $(DATS_BIG)
	(cd graph.big && ./plot.plt)

$(IMGS_SMALL): graph.small/plot.plt common.plt $(DATS_SMALL)
	(cd graph.small && ./plot.plt)

$(IMGS_AUDIT): graph.audit/plot.plt common.plt $(DATS_AUDIT)
	(cd graph.audit && ./plot.plt)
