# Makefile
# CSE 333 Lecture 11 code

CXX = g++
CPPFLAGS = -Wall -g -std=c++17
PROGS = fork_example forklatency threadlatency

# default target attempts to build all executables
all: $(PROGS)

# fork example
fork_example: fork_example.cc
	$(CXX) $(CPPFLAGS) -o $@ $^

# fork timing
forklatency: forklatency.cc
	$(CXX) $(CPPFLAGS) -o $@ $^

# thread timing
threadlatency: threadlatency.cc
	$(CXX) $(CPPFLAGS) -pthread -o $@ $^

# phony target - remove generated files and backups
clean:
	rm -rf *.o *~ *.dSYM $(PROGS)