####################################################################
#   Copyright (c) 1996 NPACT Working Group. You may copy,          #
#   distribute, and modify it freely as long as you preserve this  #
#   copyright and permission notice.                               #
#                                                                  #
#   NPACT Working Group is a joint force of                        #
#      NPAC at Syracuse University,                                #
#      PACT at Harbin Institute of Technology, and                 #
#      PACT at Peking University                                   #
####################################################################

#
#  Makefile for unparse
#

SHELL       = /bin/sh

VERSION     = @VERSION@

srcdir      = @srcdir@
top_srcdir  = @top_srcdir@

prefix      = @prefix@
exec_prefix = @exec_prefix@

bindir      = @bindir@
libdir      = @libdir@

INCLUDEDIR = ${top_srcdir}/src/include
config_dir = ../../include

LIBDIR = ../../basicop

ULIBS = -lbasic

CFLAGS= @CFLAGS@ @DEFS@ -I. -I${srcdir} -I$(config_dir) -I$(INCLUDEDIR)
CC = @CC@

VPATH=.:${srcdir}

PROGRAM=unparse

OBJS=munparse.o unparse.o db.o dbutils.o lowa.o make_nodes.o\
     db_unp_vpc.o db_unp.o 

.SUFFIXES:
.SUFFIXES: .c .o

.c.o:
	$(CC) -c $(CFLAGS) $<

all: Makefile $(PROGRAM)

Makefile: ${srcdir}/Makefile.in
	@echo 
	@echo Please configure the package to generate new makefile ...
	@exit 1

$(PROGRAM):$(OBJS) $(LIBDIR)/libbasic.a
	$(CC) -g -o $@ $(OBJS)  -L$(LIBDIR) $(ULIBS)

clean:
	rm -f *.o core
	rm -f $(PROGRAM)

install: $(PROGRAM)
	if [ ! -d ${bindir} ] ; then mkdir ${bindir} ; fi
	cp $(PROGRAM) ${bindir}

uninstall:
	rm -f ${bindir}/$(PROGRAM)

#       
# file dependence information
#

munparse.o : munparse.c ext_lib.h db.h
unparse.o : unparse.c unparse.def unparseJava.def
lowa.o : lowa.c ${INCLUDEDIR}/bif_node.def
db.o : db.c
dbutils.o : dbutils.c
low_level.o : low_level.c
make_nodes.o : make_nodes.c
db_unp_vpc.o : db_unp_vpc.c
db_unp.o : db_unp.c






