CXX = g++ ERROR = 2>error.txt CXXFLAGS= -O2 -g -std=c++11 TARGET = main.exe TARGET2 = main2.exe SOURCES = main.cpp IN = < in.txt OUT = > out.txt all:$(SOURCES) @echo $(SOURCES) $(CXX) $(SOURCES) $(CXXFLAGS) -o $(TARGET) $(ERROR) $(TARGET) $(IN) $(OUT) $(TARGET2):$(SOURCES) $(CXX) $(SOURCES) $(CXXFLAGS) -o $@ $(ERROR) clean: del *.exe