BASEDIR = /opt/cona
TARGET = $(BASEDIR)/lib/libCCC.so
PREFIX_LIB = /usr/lib /usr/local/lib
PREFIX_INCLUDE = /usr/local/include
INSTALL_HEADERS =
CXX = g++
INCLUDES = -I. -I/usr/local/include -I$(BASEDIR)/include -I$(BASEDIR)/src/TaskMgr -I$(BASEDIR)/src/log -I$(BASEDIR)/src/NetTransfer -I$(BASEDIR)/src/Util
LIBS = -lUtil -lACE -lNetTransfer -lTaskMgr -lLogMgr
CFLAGS =-g -O3 -fPIC -Wall -Werror #-D_LEO_DEBUG_=1
LINKFLAGS = -shared -L $(BASEDIR)/lib -L/usr/local/lib
CPP_SOURCES = $(wildcard *.cpp)
CPP_OBJS = $(patsubst %.cpp, %.o, $(CPP_SOURCES))
.cpp.o:
$(CXX) -c -o $*.o $(CFLAGS) $(INCLUDES) $*.cpp
compile: $(CPP_OBJS)
$(CXX) $(LINKFLAGS) -o $(TARGET) $^ $(LIBS)
clean:
rm -f $(CPP_OBJS)
rm -f $(TARGET)
install: $(TARGET)
cp $(TARGET) $(PREFIX_LIB)
cp $(INSTALL_HEADERS) $(PREFIX_INCLUDE)
uninstall:
rm -f $(PREFIX_LIB)/$(TARGET)
cd $(PREFIX_INCLUDE); rm -f $(INSTALL_HEADERS)
rebuild: clean compile
阅读(1237) | 评论(0) | 转发(0) |