# Makefile
# CSE 333 Lecture 16 code

CXX = g++
CPPFLAGS = -Wall -g -std=c++17
PROGS = copysemantics movesemantics sharedbug sharedexample sharedvec strongcycle unique1 unique2 unique3 unique4 unique5 uniquemap uniquevecsort usingweak weakcycle

all: $(PROGS) animals

copysemantics: copysemantics.cc
	$(CXX) $(CPPFLAGS) -o $@ $<

movesemantics: movesemantics.cc
	$(CXX) $(CPPFLAGS) -o $@ $<

sharedbug: sharedbug.cc
	$(CXX) $(CPPFLAGS) -o $@ $<

sharedexample: sharedexample.cc
	$(CXX) $(CPPFLAGS) -o $@ $<

sharedvec: sharedvec.cc
	$(CXX) $(CPPFLAGS) -o $@ $<

strongcycle: strongcycle.cc
	$(CXX) $(CPPFLAGS) -o $@ $<

unique1: unique1.cc
	$(CXX) $(CPPFLAGS) -o $@ $<

unique2: unique2.cc
	$(CXX) $(CPPFLAGS) -o $@ $<

unique3: unique3.cc
	$(CXX) $(CPPFLAGS) -o $@ $<

unique4: unique4.cc
	$(CXX) $(CPPFLAGS) -o $@ $<

unique5: unique5.cc
	$(CXX) $(CPPFLAGS) -o $@ $<

# This isn't supposed to compile successfully
uniquefail: uniquefail.cc
	$(CXX) $(CPPFLAGS) -o $@ $<

uniquemap: uniquemap.cc
	$(CXX) $(CPPFLAGS) -o $@ $<

# This isn't supposed to compile successfully
uniquevec: uniquevec.cc
	$(CXX) $(CPPFLAGS) -o $@ $<

uniquevecsort: uniquevecsort.cc
	$(CXX) $(CPPFLAGS) -o $@ $<

usingweak: usingweak.cc
	$(CXX) $(CPPFLAGS) -o $@ $<

weakcycle: weakcycle.cc
	$(CXX) $(CPPFLAGS) -o $@ $<

# animals live-coding
# - not included in PROGS because created in class
animals: animals.cc
	$(CXX) $(CPPFLAGS) -o $@ $<

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