SRC=$(wildcard *.cpp)
EXE=$(addsuffix .exe, $(basename $(SRC)))
CPPC=g++ -std=c++14
CPPC_FLAGS=-Wall -Wextra -pedantic -O3

all : this
	cd dco && $(MAKE)
	cd hand && $(MAKE)
	diff hand/f_a.out dco/f_a.out
	vimdiff f_ffd.out dco/f_a.out

this : $(EXE) 
	./f.exe 1000 100 >f.out
	./f_ffd.exe 1000 100 >f_ffd.out

%.exe : %.cpp f.h
	$(CPPC) $(CPPC_FLAGS) $< -o $@

clean :
	cd dco && $(MAKE) clean
	cd hand && $(MAKE) clean
	rm -f $(EXE) *.out

.PHONY: all this clean

