# Makefile
# CSE 333 Lecture 11 code

CXX = g++
CPPFLAGS = -Wall -g -std=c++17
PROGS = lock_example nolock_example thread_example

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

# thread example
thread_example: thread_example.cc
	$(CXX) $(CPPFLAGS) -pthread -o $@ $^

# lock example
lock_example: lock_example.cc
	$(CXX) $(CPPFLAGS) -pthread -o $@ $^

# lock example with locks omitted
nolock_example: nolock_example.cc
	$(CXX) $(CPPFLAGS) -pthread -o $@ $^

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