topsrc = @top_srcdir@
datarootdir = @datarootdir@

prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
CC = @CC@
CFLAGS = @CFLAGS@
MAKE = @MAKE@
INSTALL = @INSTALL@
LN = @LN_S@
XML_CFLAGS = @XML_CFLAGS@
XML_LIBS = @XML_LIBS@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_LIBS = @GLIB_LIBS@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
LAPACK_LIBS = @LAPACK_LIBS@
FFTW_CFLAGS = @FFTW_CFLAGS@
FFTW_LIBS = @FFTW_LIBS@

CURRENT=@LIBGRETL_CURRENT@
REVISION=@LIBGRETL_REVISION@
AGE=@LIBGRETL_AGE@

have_gtk = @have_gtk@

datadir = @datadir@
CPPFLAGS = @CPPFLAGS@ -DDATADIR=\"$(datadir)\"
LDFLAGS = @LDFLAGS@
INTL_LIBS = @LTLIBINTL@

ifeq ($(INSTALL_PROGRAM),)
  INSTALL_PROGRAM = $(INSTALL) -m 755
endif
ifeq ($(INSTALL_DATA),)
  INSTALL_DATA = $(INSTALL) -m 644
endif
ifeq ($(LN),)
  LN = ln -sf
endif

# Installation directories
libdir = $(prefix)/lib
includedir = $(prefix)/include/gretl
aclocaldir = $(prefix)/share/aclocal
pkgconfigdir = $(prefix)/libdata/pkgconfig

INSTALLDIRS = $(libdir) $(includedir) $(aclocaldir)

LIBGRETL = libgretl-1.0.la 

# Libraries:
ifeq ($(have_gtk),2.0)
  INSTALLDIRS += $(pkgconfigdir)
  INSTALL_CFG = install-cfg-new
else
  INSTALL_CFG = install-cfg-old
endif

# hard-coded -L/usr/local/lib is a bodge!!

LIBS = $(LAPACK_LIBS) -lm -lz $(XML_LIBS) \
	$(GLIB_LIBS) $(GMP_LIBS) $(FFTW_LIBS) $(INTL_LIBS)

#### End of system configuration section. ####

libsrc  = $(topsrc)/lib/src
cephessrc = $(topsrc)/cephes
minpacksrc = $(topsrc)/minpack
VPATH = $(libsrc):$(cephessrc):$(minpacksrc)

PUBLIC_HDRS = \
	adf_kpss.h \
	bhhh_max.h \
	bootstrap.h \
	calendar.h \
	compare.h \
	compat.h \
	dataio.h \
	dataset.h \
	dbread.h \
	describe.h \
	discrete.h \
	estimate.h \
	forecast.h \
	genmain.h \
	genfuncs.h \
	graphing.h \
	gretl_commands.h \
	gretl_errors.h \
	gretl_fft.h \
	gretl_func.h \
	gretl_intl.h \
	gretl_list.h \
	gretl_matrix.h \
	gretl_model.h \
	gretl_panel.h \
	gretl_paths.h \
	gretl_prn.h \
	gretl_restrict.h \
	gretl_string_table.h \
	gretl_utils.h \
	gretl_win32.h \
	gretl_www.h \
	gretl_xml.h \
	interact.h \
	kalman.h \
	libgretl.h \
	libset.h \
	matrix_extra.h \
	missing.h \
	modelprint.h \
	modelspec.h \
	monte_carlo.h \
	nls.h \
	nonparam.h \
	objstack.h \
	options.h \
	plotspec.h \
	plugins.h \
	printout.h \
	pvalues.h \
	qr_estimate.h \
	random.h \
	strutils.h \
	subsample.h \
	system.h \
	texprint.h \
	transforms.h \
	tsls.h \
	usermat.h \
	var.h \
	varprint.h 

SRCS = adf_kpss.c \
	bhhh_max.c \
	bootstrap.c \
	calendar.c \
	compare.c \
	compat.c \
	dataio.c \
	dataset.c \
	dbread.c \
	dbwrite.c \
	describe.c \
	discrete.c \
	estimate.c \
	forecast.c \
	geneval.c \
	genfuncs.c \
	genlex.c \
	genmain.c \
	gensyntax.c \
	gmm.c \
	graphing.c \
	gretl_commands.c \
	gretl_errors.c \
	gretl_fft.c \
	gretl_func.c \
	gretl_intl.c \
	gretl_list.c \
	gretl_matrix.c \
	gretl_model.c \
	gretl_panel.c \
	gretl_paths.c \
	gretl_prn.c \
	gretl_restrict.c \
	gretl_string_table.c \
	gretl_utils.c \
	gretl_www.c \
	gretl_xml.c \
	interact.c \
	kalman.c \
	libset.c \
	matrix_extra.c \
	missing.c \
	modelprint.c \
	modelspec.c \
	monte_carlo.c \
	nls.c \
	nonparam.c \
	objstack.c \
	options.c \
	plotspec.c \
	plugins.c \
	printout.c \
	pvalues.c \
	qr_estimate.c \
	random.c \
	strutils.c \
	subsample.c \
	system.c \
	texprint.c \
	transforms.c \
	tsls.c \
	usermat.c \
	var.c \
	varprint.c

CEPHES_SRC = bdtr.c btdtr.c chbevl.c chdtr.c const.c expx2.c \
	   fdtr.c gamma.c gdtr.c igam.c igami.c incbet.c incbi.c \
	   mtherr.c nbdtr.c ndtr.c ndtri.c pdtr.c polevl.c \
	   stdtr.c unity.c 

MINPACK_SRC = chkder.c dpmpar.c enorm.c fdjac2.c lmder.c lmder1.c \
	lmdif.c lmpar.c qrfac.c qrsolv.c dlog10.c

LOBJS = $(SRCS:.c=.lo)
AUX_LOBJ = $(CEPHES_SRC:.c=.lo) $(MINPACK_SRC:.c=.lo)

LIBTOOL = @LIBTOOL@

override CFLAGS += -I.. -I$(topsrc) -I$(libsrc) $(XML_CFLAGS) $(GLIB_CFLAGS) \
	$(GMP_CFLAGS) $(FFTW_CFLAGS) $(CPPFLAGS) -DHAVE_CONFIG_H

COMPILE = $(LIBTOOL) --mode=compile $(CC) -c $(CFLAGS) 

%.lo: %.c
	$(COMPILE) -o $@ $<
	$(CC) $(CFLAGS) -MM -MT $*.lo $< > .deps/$*.d

$(LIBGRETL): .deps $(LOBJS) $(AUX_LOBJ)
	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $(LOBJS) $(AUX_LOBJ) \
	-rpath $(prefix)/lib $(LIBS) \
	-version-info $(CURRENT):$(REVISION):$(AGE)

.deps:
	mkdir $@

-include .deps/*.d

.PHONY: 

install: $(LIBGRETL) install-data
	$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $< $(libdir)/$<

install-strip: $(LIBGRETL) install-data
	$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) -s $< $(libdir)/$<

install-data: installdirs $(INSTALL_CFG)
	for f in $(PUBLIC_HDRS) ; do \
	$(INSTALL_DATA) $(libsrc)/$$f $(includedir) ; done

install-cfg-old: ../gretl-config
	$(INSTALL_PROGRAM) ../gretl-config $(bindir)
	$(INSTALL_DATA) $(topsrc)/gretl.m4 $(aclocaldir)

install-cfg-new: ../gretl.pc
	$(INSTALL_DATA) ../gretl.pc $(pkgconfigdir)

installdirs:
	$(topsrc)/tools/mkinstalldirs $(INSTALLDIRS)

clean:
	rm -f *.lo *.o $(LIBGRETL)
	rm -rf .libs .deps

distclean: clean
	rm -f Makefile

tags:
	$(MAKE) -C $(topsrc) tags





syntax highlighted by Code2HTML, v. 0.9.1