#
# default base directory for YAP installation
# (EROOT for architecture-dependent files)
#
prefix = /usr/pkg
exec_prefix = ${prefix}
ROOTDIR = $(prefix)
EROOTDIR = ${prefix}
abs_top_builddir = /tmp/pkgbuild/lang/yap/work.alpha/yap-6.3.3
#
# where the binary should be
#
BINDIR = $(EROOTDIR)/bin
#
# where YAP should look for libraries
#
LIBDIR=${exec_prefix}/lib
YAPLIBDIR=${exec_prefix}/lib/Yap
#
#
CC=gcc
CFLAGS= -fPIC -O3 -fomit-frame-pointer -Wall -Wstrict-prototypes -Wmissing-prototypes -O2 -mieee -D_FORTIFY_SOURCE=2 -I/usr/include -I/usr/pkg/include $(YAP_EXTRAS) $(DEFS) -I$(srcdir) -I../.. -I$(srcdir)/../../include 
#
#
# You shouldn't need to change what follows.
#
INSTALL=/usr/bin/install -c -o pbulk -g users
INSTALL_DATA=/usr/bin/install -c -o pbulk -g users -m 644
INSTALL_PROGRAM=/usr/bin/install -c -s -o pbulk -g users -m 755
SHELL=/bin/sh
RANLIB=ranlib
srcdir=.
SO=so
#4.1VPATH=.:./OPTYap
CWD=$(PWD)
#

OBJS=matlab.o
SOBJS=matlab.so

#in some systems we just create a single object, in others we need to
# create a libray

all: $(SOBJS) 

matlab.o: $(srcdir)/matlab.c
	$(CC) -c $(CFLAGS) $(srcdir)/matlab.c -o matlab.o

%.so: %.o
	gcc -shared -Wl,-export-dynamic -o $@ $<   -L$(abs_top_builddir) -Wl,-R,$(YAPLIBDIR)

matlab.so: matlab.o
	gcc -shared -Wl,-export-dynamic -o matlab.so matlab.o   -L$(abs_top_builddir) -Wl,-R,$(YAPLIBDIR)

install: all
	$(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(YAPLIBDIR)

clean:
	rm -f *.o *~ $(OBJS) $(SOBJS) *.BAK

