db_bridge/Makefile
changeset 20 5fec678f931b
parent 17 b3731a25b9ec
child 66 2b4f786d9073
--- a/db_bridge/Makefile
+++ b/db_bridge/Makefile
@@ -4,6 +4,10 @@
 	mysql_db \
 	postgresql_db
 
+OBJECTS=\
+	main.o \
+	console.o
+
 .SUFFIXES: .cpp
 
 .cpp.o:
@@ -11,13 +15,13 @@
 
 all: $(TARGET)
 
-mysql_db: mysql_db.o main.o
-	$(CC) $< main.o -lmysqlclient -o $@
+mysql_db: mysql_db.o $(OBJECTS)
+	$(CC) $< $(OBJECTS) -lmysqlclient -o $@
 	rm -f main.o
 
-postgresql_db: postgresql_db.o main.cpp
+postgresql_db: postgresql_db.o $(OBJECTS)
 	$(CC) -c $(CFLAGS) -DWITH_POSTGRESQL main.cpp
-	$(CC) $< main.o -lpq -o $@
+	$(CC) $< $(OBJECTS) -lpq -o $@
 	rm -f main.o
 
 .PHONY: clean