# Copyright 2020 Joshua Bakita # Build the DIS benchmarks with all-pairs or unpaired instrumentation # (I know that this Makefile is mildly evil and breaks so many rules # that a good Makefile should follow. Sorry - at least I have one.) LIBLITMUS ?= /media/speedy/litmus/liblitmus CC ?= gcc CFLAGS += -pthread -O2 -I.. LDFLAGS = -lrt -lm COMMON = ../extra.h # Handle cases where we're also profiling with the MMDC on the i.MX6Q ifneq ($(shell grep "define MMDC 1" ../extra.h),) COMMON += /media/speedy/litmus/tools/mmdc/mmdc.c endif # Include all the LITMUS^RT headers if we're using it ifneq ($(shell grep "define LITMUS 1" ../extra.h),) CFLAGS += -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/arm/include LDFLAGS += -L${LIBLITMUS} -llitmus endif all: baseline debug: baseline debug_pairs: pairs debug debug_pairs: CFLAGS += -ggdb3 baseline: field matrix neighborhood pointer transitive update random_walk pairs: field_all matrix_all neighborhood_all pointer_all transitive_all update_all .PHONY: clean clean: rm -f field_all matrix_all neighborhood_all pointer_all \ transitive_all update_all field matrix neighborhood \ pointer transitive update random_walk field: ${COMMON} ./Field/field.c $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) matrix: ${COMMON} ./Matrix/ver2/matrix.c $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) neighborhood: ${COMMON} ./Neighborhood/neighborhood.c $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) pointer: ${COMMON} ./Pointer/pointer.c $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) transitive: ${COMMON} ./Transitive/transitive.c $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) update: ${COMMON} ./Update/update.c $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) random_walk: ${COMMON} random_walk.c $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) field_all: ${COMMON} ./Field/field.c $(CC) $(CFLAGS) -DPAIRED $^ -o $@ $(LDFLAGS) matrix_all: ${COMMON} ./Matrix/ver2/matrix.c $(CC) $(CFLAGS) -DPAIRED $^ -o $@ $(LDFLAGS) neighborhood_all: ${COMMON} ./Neighborhood/neighborhood.c $(CC) $(CFLAGS) -DPAIRED $^ -o $@ $(LDFLAGS) pointer_all: ${COMMON} ./Pointer/pointer.c $(CC) $(CFLAGS) -DPAIRED $^ -o $@ $(LDFLAGS) transitive_all: ${COMMON} ./Transitive/transitive.c $(CC) $(CFLAGS) -DPAIRED $^ -o $@ $(LDFLAGS) update_all: ${COMMON} ./Update/update.c $(CC) $(CFLAGS) -DPAIRED $^ -o $@ $(LDFLAGS)