2014-01-24 19:59:42 +00:00
|
|
|
#
|
|
|
|
# default base directory for YAP installation
|
|
|
|
# (EROOT for architecture-dependent files)
|
|
|
|
#
|
|
|
|
prefix = @prefix@
|
|
|
|
exec_prefix = @exec_prefix@
|
|
|
|
ROOTDIR = $(prefix)
|
|
|
|
EROOTDIR = @exec_prefix@
|
|
|
|
abs_top_builddir = @abs_top_builddir@
|
|
|
|
#
|
|
|
|
# where the binary should be
|
|
|
|
#
|
|
|
|
BINDIR = $(EROOTDIR)/bin
|
|
|
|
#
|
|
|
|
# where YAP should look for libraries
|
|
|
|
#
|
|
|
|
LIBDIR=@libdir@
|
|
|
|
SHAREDIR=$(ROOTDIR)/share/Yap
|
|
|
|
YAPLIBDIR=@libdir@/Yap
|
|
|
|
#
|
|
|
|
#
|
|
|
|
CC=@CC@
|
|
|
|
YAP_EXTRAS=@YAP_EXTRAS@
|
2015-02-16 11:44:37 +00:00
|
|
|
CFLAGS= $(YAP_EXTRAS) @SHLIB_CFLAGS@ $(YAP_EXTRAS) $(DEFS) -I$(srcdir) -I../.. -I$(srcdir)/../../include -I$(srcdir)/../../H -I$(srcdir)/../../OPTYap -I$(srcdir)/../../os @MYDDAS_CPPFLAGS@
|
2015-06-19 01:19:48 +01:00
|
|
|
LDFLAGS=@LDFLAGS@ @MYDDAS_LDFLAGS@
|
2015-03-28 21:55:29 +00:00
|
|
|
ECPP=@ECPP@
|
2014-01-24 19:59:42 +00:00
|
|
|
#
|
|
|
|
#
|
|
|
|
# You shouldn't need to change what follows.
|
|
|
|
#
|
|
|
|
INSTALL=@INSTALL@
|
|
|
|
INSTALL_DATA=@INSTALL_DATA@
|
|
|
|
INSTALL_PROGRAM=@INSTALL_PROGRAM@
|
|
|
|
SHELL=/bin/sh
|
|
|
|
RANLIB=@RANLIB@
|
|
|
|
srcdir=@srcdir@
|
|
|
|
SO=@SO@
|
|
|
|
#4.1VPATH=@srcdir@:@srcdir@/OPTYap
|
|
|
|
CWD=$(PWD)
|
|
|
|
#
|
|
|
|
|
|
|
|
MYDDAS_HEADERS= \
|
2015-03-28 21:55:29 +00:00
|
|
|
$(srcdir)/myddas.h $(srcdir)/myddas_structs.h \
|
2014-01-24 19:59:42 +00:00
|
|
|
$(srcdir)/myddas_statistics.h \
|
|
|
|
$(srcdir)/myddas_statistics_structs.h \
|
|
|
|
$(srcdir)/myddas_wkb.h $(srcdir)/myddas_wkb2prolog.h
|
|
|
|
|
|
|
|
MYDDAS_SOURCES= \
|
|
|
|
myddas_mysql.c \
|
|
|
|
myddas_odbc.c \
|
2015-02-16 11:44:37 +00:00
|
|
|
myddas_postgres.c \
|
2015-02-04 10:53:04 +00:00
|
|
|
myddas_sqlite3.c \
|
2015-03-23 16:17:24 +00:00
|
|
|
myddas_util.c \
|
2014-01-24 19:59:42 +00:00
|
|
|
myddas_initialization.c \
|
|
|
|
myddas_shared.c \
|
|
|
|
myddas_statistics.c \
|
|
|
|
myddas_top_level.c \
|
|
|
|
myddas_wkb2prolog.c
|
|
|
|
|
|
|
|
MYDDAS_PROLOG= \
|
2015-03-08 02:15:53 +00:00
|
|
|
myddas.ypp \
|
2015-03-28 21:55:29 +00:00
|
|
|
myddas_assert_predicates.ypp \
|
2015-03-08 02:15:53 +00:00
|
|
|
myddas_mysql.ypp \
|
|
|
|
myddas_sqlite3.ypp \
|
2015-04-15 11:21:15 +01:00
|
|
|
myddas_top_level.ypp \
|
2015-03-08 02:15:53 +00:00
|
|
|
myddas_errors.ypp \
|
|
|
|
myddas_postgres.ypp \
|
|
|
|
myddas_prolog2sql.ypp \
|
|
|
|
myddas_util_predicates.ypp \
|
|
|
|
myddas_prolog2sql_optimizer.ypp
|
|
|
|
|
2014-01-24 19:59:42 +00:00
|
|
|
|
|
|
|
OBJS= $(MYDDAS_SOURCES:.c=.o)
|
2015-03-08 02:15:53 +00:00
|
|
|
MYDDAS_YAP= $(MYDDAS_PROLOG:.ypp=.yap)
|
2015-03-23 16:17:24 +00:00
|
|
|
SOBJS= myddas.@SO@
|
2014-01-24 19:59:42 +00:00
|
|
|
|
|
|
|
#in some systems we just create a single object, in others we need to
|
|
|
|
# create a libray
|
|
|
|
|
2015-04-15 11:21:15 +01:00
|
|
|
all: $(SOBJS) myddas-yap
|
|
|
|
|
|
|
|
myddas-yap: $(MYDDAS_YAP)
|
2014-01-24 19:59:42 +00:00
|
|
|
|
2015-03-08 02:15:53 +00:00
|
|
|
.PRECIOUS: %.o %.yap
|
2014-01-24 19:59:42 +00:00
|
|
|
|
|
|
|
%.o: $(srcdir)/%.c
|
|
|
|
$(CC) -c $(CFLAGS) $< -o $@
|
|
|
|
|
2015-03-08 02:15:53 +00:00
|
|
|
%.yap: $(srcdir)/pl/%.ypp
|
2015-04-13 13:28:17 +01:00
|
|
|
$(ECPP) $(YAP_EXTRAS) -P -w $< > $@
|
2015-03-08 02:15:53 +00:00
|
|
|
|
2014-01-24 19:59:42 +00:00
|
|
|
@DO_SECOND_LD@%.@SO@: $(OBJS)
|
2015-03-23 07:27:10 +00:00
|
|
|
@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o $@ $(OBJS) @EXTRA_LIBS_FOR_DLLS@ @MYDDAS_LIBS@
|
2014-01-24 19:59:42 +00:00
|
|
|
|
2014-02-13 01:58:48 +00:00
|
|
|
install: all install_myddas install-examples
|
2014-01-24 19:59:42 +00:00
|
|
|
mkdir -p $(DESTDIR)$(SHAREDIR)
|
|
|
|
$(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(YAPLIBDIR)
|
|
|
|
|
2014-02-12 23:35:00 +00:00
|
|
|
install-examples:
|
|
|
|
|
2014-01-24 19:59:42 +00:00
|
|
|
install_myddas:
|
|
|
|
count=`echo "$(YAP_EXTRAS)" | grep MYDDAS | wc -l`; \
|
|
|
|
if [ $$count -ne 0 ]; then \
|
2015-03-23 07:27:10 +00:00
|
|
|
mkdir -p $(DESTDIR)$(SHAREDIR); \
|
|
|
|
for p in $(MYDDAS_PROLOG); \
|
|
|
|
do name=`basename $$p .ypp`; echo $$name;\
|
|
|
|
$(INSTALL_DATA) $$name.yap $(DESTDIR)$(SHAREDIR); \
|
|
|
|
done; \
|
2014-01-24 19:59:42 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.o *~ $(OBJS) $(SOBJS) *.BAK
|
|
|
|
|
2014-02-12 23:35:00 +00:00
|
|
|
distclean: clean
|
|
|
|
rm -f Makefile
|