Makefile 简单基本示例

Posted by VK on December 6, 2017

Makefile 简单基本示例

CXX := g++ -O0 
CXXFLAGS := -std=c++11 -O0 

all: ProjectPartA ProjectPartB

ProjectPartA: ProjectPartA.o
	$(CXX) -o $@ $^

ProjectPartB: ProjectPartB.o
	$(CXX) -o $@ $^

test: 
	./ProjectPartA
	./ProjectPartB

BIN=ProjectPartA ProjectPartB

clean:
	rm -f *.o $(BIN)

.PHONY: all clean test