link_flag = `mysql_config --libs`
all:server client test
server:server.o connection.o table.o sqlerror.o
g++ -o $@ $^ -lpthread $(link_flag)
server.o:server.cpp connection.hpp table.hpp
g++ -o $@ -c $<
connection.o:connection.cpp sqlerror.hpp
g++ -o $@ -c $<
table.o:table.cpp connection.hpp sqlerror.hpp
g++ -o $@ -c $<
sqlerror.o:sqlerror.cpp
g++ -o $@ -c $<
client:client.o
g++ -o $@ $< -lpthread
client.o:client.cpp
g++ -o $@ -c $<
test:test.o
g++ -o $@ $<
test.o:test.cpp
g++ -o $@ -c $<
clean:
find . | grep [0-9] | xargs rm -rf
rm -rf *.o
rm -rf server
rm -rf client
rm -rf test
all:server client test
server:server.o connection.o table.o sqlerror.o
g++ -o $@ $^ -lpthread $(link_flag)
server.o:server.cpp connection.hpp table.hpp
g++ -o $@ -c $<
connection.o:connection.cpp sqlerror.hpp
g++ -o $@ -c $<
table.o:table.cpp connection.hpp sqlerror.hpp
g++ -o $@ -c $<
sqlerror.o:sqlerror.cpp
g++ -o $@ -c $<
client:client.o
g++ -o $@ $< -lpthread
client.o:client.cpp
g++ -o $@ -c $<
test:test.o
g++ -o $@ $<
test.o:test.cpp
g++ -o $@ -c $<
clean:
find . | grep [0-9] | xargs rm -rf
rm -rf *.o
rm -rf server
rm -rf client
rm -rf test