# Makefile for form source code.
#
# This makes the following:
#	libraries (normal/debug/profile/shared)
#
# The variable 'srcdir' refers to the source-distribution, and can be set with
# the configure script by "--srcdir=DIR".
#
# The rules are organized to produce the libraries for the configured models,

# turn off _all_ suffix rules; we'll generate our own
.SUFFIXES:

SHELL		= /bin/sh
THIS		= Makefile

MODEL		= @DFT_LWR_MODEL@
srcdir		= @srcdir@
prefix		= @prefix@
exec_prefix	= @exec_prefix@
libdir		= $(exec_prefix)/lib
includedir	= @includedir@

INSTALL		= @INSTALL@
INSTALL_DATA	= @INSTALL_DATA@

AWK		= @AWK@
LN_S		= @LN_S@

CC		= @CC@
CFLAGS		= @CFLAGS@

CPPFLAGS	= @CPPFLAGS@ \
		  -DHAVE_CONFIG_H 

CCFLAGS		= $(CPPFLAGS) $(CFLAGS)

CFLAGS_NORMAL	= $(CCFLAGS)
CFLAGS_DEBUG	= $(CCFLAGS) @CC_G_OPT@ -DTRACE
CFLAGS_PROFILE	= $(CCFLAGS) -pg
CFLAGS_SHARED	= $(CCFLAGS) @CC_SHARED_OPTS@

CFLAGS_DEFAULT	= $(CFLAGS_@DFT_UPR_MODEL@)

LINK		= $(CC)
LDFLAGS		= @LDFLAGS@ @LD_MODEL@ @LIBS@

MK_SHARED_LIB	= @MK_SHARED_LIB@
REL_VERSION	= @nc_cv_rel_version@
ABI_VERSION	= @nc_cv_abi_version@

RANLIB		= @RANLIB@

LIBRARIES	= @LIBS_TO_MAKE@

################################################################################
all ::	../include/form.h $(LIBRARIES)

install :: install.libs

install.libs:: $(includedir) $(libdir)
	$(INSTALL_DATA) $(srcdir)/form.h $(includedir)/form.h

$(includedir) \
$(libdir) :
	$(srcdir)/../mkinstalldirs $@

# make copies to simplify include-paths while still keeping form's include
# file in this directory.
../include/form.h : $(srcdir)/form.h
	-rm -f $@
	cp $(srcdir)/form.h $@

tags:
	ctags *.[ch]

TAGS:
	etags *.[ch]

clean ::
	-rm -f tags TAGS *~ ../include/form.h

distclean: clean
	-rm -f Makefile

mostlyclean: clean

realclean: distclean

###############################################################################
# The remainder of this file is automatically generated during configuration
###############################################################################
