# ParlayLib (header-only). Hardcoded for now to the copy in
# ~/proj/scheduler-augmentation, which extends the stock ParlayLib scheduler
# with scheduler augmentation.
#
# Add -DPARLAY_NOOP_VERTEX to CXXFLAGS to compile out all augmentation
# machinery (identical to stock ParlayLib).
PARLAY_INCLUDE ?= $(HOME)/proj/scheduler-augmentation/include

# The graph-viz branch of the same project, which traces the fork-join
# structure of an execution to a file for visualization (see visualize.sh).
PARLAY_VIZ ?= $(HOME)/proj/scheduler-augmentation-viz

CXX      ?= c++
CXXFLAGS := -O2 -std=c++17 -pthread

main: *.cpp *.h
	$(CXX) $(CXXFLAGS) -isystem $(PARLAY_INCLUDE) main.cpp -o main

# Same program, compiled against the graph-tracing library. Writes a trace of
# every augmented run (each timed run of a benchmark) to $$PARLAY_TRACE_FILE
# (default: parlay.trace).
main.aug: *.cpp *.h
	$(CXX) $(CXXFLAGS) -DPARLAY_AUG -isystem $(PARLAY_VIZ)/include -isystem $(PARLAY_VIZ)/include/spdlog/include main.cpp -o main.aug

clean:
	rm -rf main main.aug traces logs_vertex.txt parlay.trace

.PHONY: clean
