PROJECTS=solution SOURCE_FILES=*.c *.cpp *.md *.pro input*.txt Makefile output*.txt .gitignore CC=gcc CXX=g++ FLAGS=-Wall -g -O0 -I. -lm CFLAGS=$(FLAGS) -std=c11 CXXFLAGS=$(FLAGS) -std=c++11 all: $(PROJECTS) %: %.c $(CC) $(CFLAGS) -o $@ $< %: %.cpp $(CXX) $(CXXFLAGS) -o $@ $< .SILENT: test test: for current in 1 2 3 4 5 6 7 8 9 ; do \ if [ -a input0$$current.txt ]; \ then \ ./solution < input0$$current.txt | diff output0$$current.txt - ; \ fi; \ done zip: zip -9 `basename $(PWD)`.zip $(SOURCE_FILES) 7z: 7z a -mx=9 `basename $(PWD)`.7z $(SOURCE_FILES) zip-tests: *.txt zip -9 test_cases.zip *.txt clean: rm -rf $(PROJECTS) given *.exe *.dSYM *.zip clean-dos: del /f/q *.exe *.zip