db_bridge/Makefile
changeset 20 5fec678f931b
parent 17 b3731a25b9ec
child 66 2b4f786d9073
equal deleted inserted replaced
19:933d86c1ff71 20:5fec678f931b
     1 CC=g++
     1 CC=g++
     2 CFLAGS=-Wall -O2 -ansi -Iinclude
     2 CFLAGS=-Wall -O2 -ansi -Iinclude
     3 TARGET=\
     3 TARGET=\
     4 	mysql_db \
     4 	mysql_db \
     5 	postgresql_db
     5 	postgresql_db
       
     6 
       
     7 OBJECTS=\
       
     8 	main.o \
       
     9 	console.o
     6 
    10 
     7 .SUFFIXES: .cpp
    11 .SUFFIXES: .cpp
     8 
    12 
     9 .cpp.o:
    13 .cpp.o:
    10 	$(CC) -c $(CFLAGS) $<
    14 	$(CC) -c $(CFLAGS) $<
    11 
    15 
    12 all: $(TARGET)
    16 all: $(TARGET)
    13 
    17 
    14 mysql_db: mysql_db.o main.o
    18 mysql_db: mysql_db.o $(OBJECTS)
    15 	$(CC) $< main.o -lmysqlclient -o $@
    19 	$(CC) $< $(OBJECTS) -lmysqlclient -o $@
    16 	rm -f main.o
    20 	rm -f main.o
    17 
    21 
    18 postgresql_db: postgresql_db.o main.cpp
    22 postgresql_db: postgresql_db.o $(OBJECTS)
    19 	$(CC) -c $(CFLAGS) -DWITH_POSTGRESQL main.cpp
    23 	$(CC) -c $(CFLAGS) -DWITH_POSTGRESQL main.cpp
    20 	$(CC) $< main.o -lpq -o $@
    24 	$(CC) $< $(OBJECTS) -lpq -o $@
    21 	rm -f main.o
    25 	rm -f main.o
    22 
    26 
    23 .PHONY: clean
    27 .PHONY: clean
    24 
    28 
    25 clean:
    29 clean: