CC=g++
#LD=/usr/bin/ld
INCLUDES=-I/usr/include/mysql -I/usr/include
LIBS=-L/lib -L/usr/lib/mysql -lmysqlclient -lpthread
CPPFLAGS = -DLINUX -D_DEBUGE -O0 -w -g -I./src
libsrcs =$(wildcard src/*.cpp)
libobjs =$(libsrcs:.cpp=.o)
des_libsrcs =$(wildcard src/*.c)
des_libobjs =$(des_libsrcs:.c=.o)
server.exe: $(libobjs) gnu-md5.o server.o $(des_libobjs)
$(CC) -DDEBUGE -g -o $@ $^ -lpthread $(INCLUDE) $(LIBS)
%.o: %.cpp
$(CC) $(CPPFLAGS) -g -c -o $@ $<
%.o: %.c
gcc -g -c -o $@ $<
server.o: server.c server.h
$(CC) -c -w -g -DLINUX -o $@ $< $(INCLUDES)
gnu-md5.o: gnu-md5.c gnu-md5.h
$(CC) -c -g -o $@ $<
clean:
rm -f server.exe server.o gnu-md5.o $(libobjs) $(des_libobjs)
### 远程拷备到服务器
install:
scp server.exe
schkui@www.hostname.com:/var/bin_path/