# Generated automatically from Makefile.in by configure.
# If this file has the name "Makefile.in" then it is a template for a
# Makefile;  to generate the actual Makefile, run "./configure", which
# is a configuration script generated by the "autoconf" program.

SHELL = /bin/sh

LIBOBJS = column.o custom.o derived.o fileio.o field.o format.o \
          handler.o persist.o std.o store.o string.o table.o univ.o \
          view.o viewx.o

SHLOBJS = column.lo custom.lo derived.lo fileio.lo field.lo format.lo \
          handler.lo persist.lo std.lo store.lo string.lo table.lo univ.lo \
          view.lo viewx.lo

PYOBJS  = PyProperty.o PyRowRef.o PyStorage.o PyView.o PWOImp.o

SPYOBJS = PyProperty.lo PyRowRef.lo PyStorage.lo PyView.lo PWOImp.lo

TSTOBJS = regress.o tbasics.o tcusto1.o tcusto2.o tformat.o tlimits.o \
          tnotify.o tresize.o tstore1.o tstore2.o tstore3.o tstore4.o

DEMOS   = demo dump myio

#---------- Autoconf settings, can be overriden as "make" args

prefix = /usr/local
exec_prefix = ${prefix}
includedir = ${prefix}/include
libdir = ${exec_prefix}/lib
srcdir = .
top_builddir = .

# not normally compiled with -g, but you can specify it in the make command
CXXFLAGS = -O3 -fomit-frame-pointer -DNDEBUG
#CXXFLAGS = -fguiding-decls -Wall -pedantic -Wno-unused -g

CXX = c++
INSTALL = $(SHELL) $(top_builddir)/libtool /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
LIBTOOL = $(SHELL) $(top_builddir)/libtool
VERSION = 2.0.1
TCL_BIN_DIR = # no Tcl configs found

#---------- Do not change, shorthand only

CXX_SWITCHES      = $(CXXFLAGS) -I../include -I../src -I.
CXX_SWITCHES_TCL  = $(CXXFLAGS) -I../include -I../../include \
			-I$(TCL_BIN_DIR)/../generic -DUSE_TCL_STUBS
CXX_SWITCHES_PY   = $(CXXFLAGS) -I../include -I../python/scxx \
			-I$(includedir)/python1.5

#---------- The targets normally specified when calling "make"

all: core

core: Makefile libmk4.a libmk4.la $(DEMOS)

tcl: Makefile libmk4tcl.a libmk4tcl.la

python: Makefile libmk4py.a libmk4py.la

test: core regress
	if [ ! -d tests ]; then mkdir tests; fi
	./regress
	diff ../tests/ok tests

test-tcl: tcl
	cd ../tcl/test && tclsh8.3 all.tcl

install: install-mk

install-mk: libmk4.a libmk4.la
	$(INSTALL_DATA) ../include/mk4.h $(includedir)/mk4.h
	$(INSTALL_DATA) ../include/mk4.inl $(includedir)/mk4.inl
	$(INSTALL_DATA) ../include/mk4str.h $(includedir)/mk4str.h
	$(INSTALL_DATA) ../include/mk4str.inl $(includedir)/mk4str.inl
	$(INSTALL_DATA) -s libmk4.a $(libdir)/libmk4.a
	$(INSTALL_PROGRAM) -s libmk4.la $(libdir)/libmk4.la

install-tcl: libmk4tcl.a libmk4tcl.la
	$(INSTALL_DATA) -s libmk4tcl.a $(libdir)/libmk4tcl.a
	$(INSTALL_PROGRAM) -s libmk4tcl.la $(libdir)/libmk4tcl.la

install-python: libmk4py.a libmk4py.la
	$(INSTALL_DATA) -s libmk4py.a $(libdir)/libmk4py.a
	$(INSTALL_PROGRAM) -s libmk4py.la $(libdir)/libmk4py.la

clean:
	rm -f *.a *.la *.o *.lo *.so
	rm -f core $(DEMOS) struct regress myfile.dat secret.dat
	rm -rf tests/[a-z]* .libs

distclean: clean
	rm -f Makefile config.h config.status config.log config.cache libtool

dist: dist-tar

disth:	# package all require headers into tars for remote use
	tar cz --dir=/usr/local/include/ -f py152h.tar.gz python1.5
	tar cz --dir=/usr/local/include/ -f tcl82h.tar.gz tcl.h tclDecls.h

#---------- This defines what each of the targets does

Makefile: $(srcdir)/Makefile.in config.status
	$(SHELL) ./config.status

config.status: $(srcdir)/configure
	$(SHELL) ./config.status --recheck

$(srcdir)/configure: $(srcdir)/configure.in
	cd $(srcdir) && autoconf

dist-tar:
	rm -rf metakit-$(VERSION)
	mkdir metakit-$(VERSION)
	cp -pr $(srcdir)/../[^b]* metakit-$(VERSION) # omit "builds"
	rm -f `find mk_src-$(VERSION) -type f -name '_*'`
	rm -rf `find metakit-$(VERSION) -type d -name CVS`
	mkdir -p metakit-$(VERSION)/builds/tests
	cp $(srcdir)/reversed metakit-$(VERSION)/builds
	echo "placeholder" >metakit-$(VERSION)/builds/tests/!keepme.txt
	tar cfz metakit-$(VERSION).tar.gz metakit-$(VERSION)
	rm -rf metakit-$(VERSION)

libmk4.a: $(LIBOBJS)
	$(LIBTOOL) --mode=link $(CXX) -o $@ $(CXX_SWITCHES) $(LIBOBJS)

libmk4.la: $(LIBOBJS)
	$(LIBTOOL) --mode=link $(CXX) -o $@ $(CXX_SWITCHES) -export-dynamic \
		-rpath $(libdir) $(SHLOBJS)

libmk4tcl.a: mk4tcl.o libmk4.a
	$(LIBTOOL) --mode=link $(CXX) -o $@ $(CXX_SWITCHES) mk4tcl.o $(LIBOBJS)

libmk4tcl.la: mk4tcl.o libmk4.a
	$(LIBTOOL) --mode=link $(CXX) -o $@ $(CXX_SWITCHES) -export-dynamic \
		-rpath $(libdir) mk4tcl.lo $(SHLOBJS) \
		-L$(libdir) -ltclstub8.3

Mk4tcl.so: mk4tcl.o libmk4.a
	$(CXX) -o $@ $(CXX_SWITCHES) -shared mk4tcl.lo $(SHLOBJS) \
		-L$(libdir) -ltclstub8.3

libmk4py.a: $(PYOBJS) libmk4.a
	$(LIBTOOL) --mode=link $(CXX) -o $@ $(CXX_SWITCHES) $(PYOBJS) $(LIBOBJS)

libmk4py.la: $(PYOBJS) libmk4.a
	$(LIBTOOL) --mode=link $(CXX) -o $@ $(CXX_SWITCHES) -export-dynamic \
		-rpath $(libdir) $(SPYOBJS) $(SHLOBJS)

Mk4py.so: $(PYOBJS) libmk4.a
	$(CXX) -o $@ $(CXX_SWITCHES) -shared $(SPYOBJS) $(SHLOBJS)

demo: ../demos/demo.cpp libmk4.a
	$(LIBTOOL) --mode=link $(CXX) $(CXX_SWITCHES) -o $@ \
		../demos/demo.cpp libmk4.a

dump: ../demos/dump.cpp libmk4.la
	$(LIBTOOL) --mode=link $(CXX) $(CXX_SWITCHES) -static -o $@ \
		../demos/dump.cpp libmk4.a

myio: ../demos/myio.cpp libmk4.la
	$(LIBTOOL) --mode=link $(CXX) $(CXX_SWITCHES) -o $@ \
		../demos/myio.cpp libmk4.la

struct: ../demos/struct.cpp
	$(LIBTOOL) --mode=link $(CXX) $(CXX_SWITCHES) -o $@ \
		../demos/struct.cpp -lmk4

regress: $(TSTOBJS) libmk4.a
	$(LIBTOOL) --mode=link $(CXX) $(CXX_SWITCHES) -static -o $@ \
		$(TSTOBJS) libmk4.a

#---------- Dependencies

mk4tcl.o: ../tcl/mk4tcl.cpp
	$(LIBTOOL) --mode=compile $(CXX) -c $(CXX_SWITCHES_TCL) $?

PyProperty.o: ../python/PyProperty.cpp
	$(LIBTOOL) --mode=compile $(CXX) -c $(CXX_SWITCHES_PY) $?
PyRowRef.o: ../python/PyRowRef.cpp
	$(LIBTOOL) --mode=compile $(CXX) -c $(CXX_SWITCHES_PY) $?
PyStorage.o: ../python/PyStorage.cpp
	$(LIBTOOL) --mode=compile $(CXX) -c $(CXX_SWITCHES_PY) $?
PyView.o: ../python/PyView.cpp
	$(LIBTOOL) --mode=compile $(CXX) -c $(CXX_SWITCHES_PY) $?
PWOImp.o: ../python/scxx/PWOImp.cpp
	$(LIBTOOL) --mode=compile $(CXX) -c $(CXX_SWITCHES_PY) $?

column.o: ../src/column.cpp
	$(LIBTOOL) --mode=compile $(CXX) -c $(CXX_SWITCHES) $?
custom.o: ../src/custom.cpp
	$(LIBTOOL) --mode=compile $(CXX) -c $(CXX_SWITCHES) $?
derived.o: ../src/derived.cpp
	$(LIBTOOL) --mode=compile $(CXX) -c $(CXX_SWITCHES) $?
field.o: ../src/field.cpp
	$(LIBTOOL) --mode=compile $(CXX) -c $(CXX_SWITCHES) $?
fileio.o: ../src/fileio.cpp
	$(LIBTOOL) --mode=compile $(CXX) -c $(CXX_SWITCHES) $?
format.o: ../src/format.cpp
	$(LIBTOOL) --mode=compile $(CXX) -c $(CXX_SWITCHES) $?
handler.o: ../src/handler.cpp
	$(LIBTOOL) --mode=compile $(CXX) -c $(CXX_SWITCHES) $?
persist.o: ../src/persist.cpp
	$(LIBTOOL) --mode=compile $(CXX) -c $(CXX_SWITCHES) $?
std.o: ../src/std.cpp
	$(LIBTOOL) --mode=compile $(CXX) -c $(CXX_SWITCHES) $?
store.o: ../src/store.cpp
	$(LIBTOOL) --mode=compile $(CXX) -c $(CXX_SWITCHES) $?
string.o: ../src/string.cpp
	$(LIBTOOL) --mode=compile $(CXX) -c $(CXX_SWITCHES) $?
table.o: ../src/table.cpp
	$(LIBTOOL) --mode=compile $(CXX) -c $(CXX_SWITCHES) $?
univ.o: ../src/univ.cpp
	$(LIBTOOL) --mode=compile $(CXX) -c $(CXX_SWITCHES) $?
view.o: ../src/view.cpp
	$(LIBTOOL) --mode=compile $(CXX) -c $(CXX_SWITCHES) $?
viewx.o: ../src/viewx.cpp
	$(LIBTOOL) --mode=compile $(CXX) -c $(CXX_SWITCHES) $?

regress.o: ../tests/regress.cpp
	$(CXX) -c $(CXX_SWITCHES) $? -o $@
tbasics.o: ../tests/tbasics.cpp
	$(CXX) -c $(CXX_SWITCHES) $? -o $@
tcusto1.o: ../tests/tcusto1.cpp
	$(CXX) -c $(CXX_SWITCHES) $? -o $@
tcusto2.o: ../tests/tcusto2.cpp
	$(CXX) -c $(CXX_SWITCHES) $? -o $@
tformat.o: ../tests/tformat.cpp
	$(CXX) -c $(CXX_SWITCHES) $? -o $@
tlimits.o: ../tests/tlimits.cpp
	$(CXX) -c $(CXX_SWITCHES) $? -o $@
tnotify.o: ../tests/tnotify.cpp
	$(CXX) -c $(CXX_SWITCHES) $? -o $@
tresize.o: ../tests/tresize.cpp
	$(CXX) -c $(CXX_SWITCHES) $? -o $@
tstore1.o: ../tests/tstore1.cpp
	$(CXX) -c $(CXX_SWITCHES) $? -o $@
tstore2.o: ../tests/tstore2.cpp
	$(CXX) -c $(CXX_SWITCHES) $? -o $@
tstore3.o: ../tests/tstore3.cpp
	$(CXX) -c $(CXX_SWITCHES) $? -o $@
tstore4.o: ../tests/tstore4.cpp
	$(CXX) -c $(CXX_SWITCHES) $? -o $@

#---------- End
