FLAGS = -Wall -g
INCLUDE=-I$(ACE_ROOT)/include
ACE_LIB=-L$(ACE_ROOT)/lib
N_LIB=-lACE
DD=-DACE_HAS_EVENT_POLL
Server:Server.o TaskWork.o
g++ -o Server Server.o TaskWork.o $(ACE_LIB) $(N_LIB) $(DD)
Server.o:Server.cpp ClassDefined.h
g++ $(FLAGS) $(INCLUDE) $(DD) -c Server.cpp -o Server.o
TaskWork.o:TaskWork.cpp ClassDefined.h
g++ $(FLAGS) $(INCLUDE) $(DD) -c TaskWork.cpp -o TaskWork.o
clean:
rm -rf Server Server.o TaskWork.o
注:编译找不到头文件,直接把头文件路径包含进去;