#
# Makefile for GtkCAD database module
#
all:

# The compiler of choice
CC = gcc 

# Installation directory
INSTDIR = .

# Include file(s):
INCLUDE = -I../include
PG_INC = -I/usr/include/postgresql
GTK_INC = -I/usr/include/gtk-1.2

# Options for development
CFLAGS = -g -Wall -ansi `gtk-config --cflags`

# Options for release
# CFLAGS = -O2 -Wall -ansi `gtk-config --cflags`

# GTK+ library
GTKLIB = `gtk-config --libs`

# LIBRARIES
LIBS = -lecpg -lpq `gtk-config --libs`


# Test object files
#
OBJS = test_db_ecpg.o \
	test_createdb_ecpg.o \
	test_get_ecpg.o \
	test_edit_ecpg.o \
	test_insert_ecpg.o

# Suffix rule to make a .c file from a .pgc file
%.c: %.pgc
	ecpg -t $(PG_INC) -o $@ $<

# Suffix rule to make a object file from a .c file
%.o: %.c
	$(CC) -c $(PG_INC) $(CFLAGS) -o $@ $<


# Make the executable
test_db:  $(OBJS)
	$(CC) $(LIBS) -o test_db  $(OBJS)


clean:
	rm ./*.o
	rm test_db