The R Project SVN R

Rev

Rev 11108 | Rev 11499 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

#
# ${R_HOME}/src/nmath/standalone/Makefile

VPATH = @srcdir@:@srcdir@/..
srcdir = @srcdir@
top_srcdir = @top_srcdir@

top_builddir = ../../..
subdir = src/nmath/standalone

include $(top_builddir)/Makeconf

SOURCES_NMATH = \
    mlutils.c \
    d1mach.c i1mach.c \
    fmax2.c fmin2.c fmod.c fprec.c fround.c ftrunc.c \
    sign.c fsign.c fsquare.c fcube.c \
    imax2.c imin2.c \
    chebyshev.c log1p.c lgammacor.c gammalims.c stirlerr.c bd0.c \
    gamma.c lgamma.c gamma_cody.c beta.c lbeta.c polygamma.c \
    bessel_i.c bessel_j.c bessel_k.c bessel_y.c \
    choose.c \
    snorm.c sexp.c \
    dgamma.c pgamma.c qgamma.c rgamma.c \
    dbeta.c pbeta.c qbeta.c rbeta.c \
    dunif.c punif.c qunif.c runif.c \
    dnorm.c pnorm.c qnorm.c rnorm.c \
    dlnorm.c plnorm.c qlnorm.c rlnorm.c \
    df.c pf.c qf.c rf.c \
    dt.c pt.c qt.c rt.c \
    dchisq.c pchisq.c qchisq.c rchisq.c \
    dbinom.c pbinom.c qbinom.c rbinom.c \
    dcauchy.c pcauchy.c qcauchy.c rcauchy.c \
    dexp.c pexp.c qexp.c rexp.c \
    dgeom.c pgeom.c qgeom.c rgeom.c \
    dhyper.c phyper.c qhyper.c rhyper.c \
    dnbinom.c pnbinom.c qnbinom.c rnbinom.c \
    dpois.c ppois.c qpois.c rpois.c \
    dweibull.c pweibull.c qweibull.c rweibull.c \
    dlogis.c plogis.c qlogis.c rlogis.c \
    dnchisq.c pnchisq.c qnchisq.c \
    dnbeta.c pnbeta.c \
    pnf.c pnt.c \
    ptukey.c qtukey.c \
    wilcox.c \
    signrank.c
SOURCES = $(SOURCES_NMATH) sunif.c
DEPENDS = $(SOURCES:.c=.ad)
OBJECTS = $(SOURCES:.c=.ao)

distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
DISTFILES = Makefile.in test.c sunif.c

LIB = libRmath.a
SHLIB = libRmath.$(SHLIB_EXT)

## FIXME: this should be libRmath.la etc ...
Rexeclibdir_LTLIBRARIES = libRmath.$(SHLIB_EXT)
libRmath_la_SOURCES = $(SOURCES)
libRmath_la_OBJECTS = $(OBJECTS:.ao=.lo)

CLEANFILES = Makedeps *.ad *.ao *.lo test
DISTCLEANFILES = Makefile $(LIB) $(SHLIB)

DEFS = -DHAVE_CONFIG_H -DMATHLIB_STANDALONE

.SUFFIXES:
.SUFFIXES: .c .ad .ao .lo

.c.ad:
    @echo "making $@ from $<"
    @$(CC) -M $(ALL_CPPFLAGS) $< > $@
.c.ao:
    $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c $< -o $@

all: Makefile Makedeps static shared
static: Makefile ../../include/Rconfig.h
    @$(MAKE) Makedeps
    @$(MAKE) $(LIB)

shared: Makefile ../../include/Rconfig.h
    @$(MAKE) Makedeps
    $(MAKE) $(SHLIB)

../../include/Rconfig.h:
    (cd $(@D); $(MAKE) $(@F))

Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(SOURCES)
    @cd $(top_builddir) && \
      CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \
      $(SHELL) ./config.status

Makedeps: Makefile ../../include/Rconfig.h $(DEPENDS)
    @cat $(DEPENDS) | sed s/\.o:/.ao:/>> Makefile
    @cat $(DEPENDS) | sed s/\.o:/.lo:/>> Makefile
    @touch $@

$(LIB): $(OBJECTS)
    $(AR) cr $(LIB) $(OBJECTS)
    $(RANLIB) $(LIB)

$(SHLIB): $(libRmath_la_OBJECTS)
## FIXME: this should be $(LTLINK) -o $@ $(libRmath_la_OBJECTS)
    $(SHLIB_LD) $(SHLIB_LDFLAGS) $(LDFLAGS) -o $@ $(libRmath_la_OBJECTS)

test: $(srcdir)/test.c
    $(CC) -o $@ $(ALL_CPPFLAGS) $(ALL_CFLAGS) $< -L. -lRmath -lm

mostlyclean: clean
clean:
    @-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean: clean
    @-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean: distclean

distdir: $(DISTFILES)
    @for f in $(DISTFILES); do \
      test -f $(distdir)/$${f} \
        || ln $(srcdir)/$${f} $(distdir)/$${f} 2>/dev/null \
        || cp -p $(srcdir)/$${f} $(distdir)/$${f}; \
    done

## Automagically generated dependencies: