makefile链接库
CXX=g++
TARGET=main
SRC=$(wildcard *.cpp)
OBJ=$(patsubst *.cpp ,-o ,$(SRC))
CXXFLAGS=-c -Wall
LIBS=-I /usr/include/mysql -L /usr/lib64/mysql #链接库
$(TARGET):$(OBJ)
$(CXX) -o $(TARGET) $(OBJ)
%.o:%.cpp
$(CXX) $(CXXFLAGS) $< -o $@ $(LIBS)
clean:
rm -rf *.o $(TARGET)