The R Project SVN R

Rev

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

#
# ${R_HOME}/src/main/Makefile

VPATH = @srcdir@
srcdir = @srcdir@
top_srcdir = @top_srcdir@

top_builddir = ../..
subdir = src/main

include $(top_builddir)/Makeconf

distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
DISTFILES = $(shell cd $(srcdir) && ls Makefile.in *.[cfhy])

SRCS = arithmetic.c array.c attrib.c bind.c builtin.c character.c       \
    coerce.c colors.c complex.c context.c cov.c cum.c debug.c       \
    deparse.c deriv.c devices.c dotcode.c dstruct.c duplicate.c     \
    envir.c errors.c eval.c format.c fourier.c gram.c gram-ex.c     \
    graphics.c iosupport.c list.c logic.c main.c match.c memory.c   \
    model.c names.c objects.c optimize.c options.c par.c paste.c    \
    platform.c plot.c plot3d.c plotmath.c print.c printarray.c      \
    printvector.c printutils.c random.c relop.c saveload.c scan.c   \
    seq.c sort.c source.c split.c subassign.c subscript.c subset.c  \
    summary.c unique.c util.c version.c
DEPS = $(SRCS:.c=.d)
OBJS = $(SRCS:.c=.o)

RLIBS = ../unix/libunix.a ../appl/libappl.a ../nmath/libmath.a
RGNOMELIBS = ../gnome/libRgnome.a ../appl/libappl.a ../nmath/libmath.a

ALL_LIBS = $(RLIBS) $(X_PRE_LIBS) $(X_LIBS) $(X_EXTRA_LIBS) $(LIBS)
ALL_GNOME_LIBS = $(RGNOMELIBS) $(LIBS) $(GNOMEUI_LIBS)

all: Makefile R

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

R: Makefile Makedeps $(top_builddir)/bin/R.binary @RGNOMEBIN@

Makedeps: ../include/Platform.h ../include/FFDecl.h $(DEPS)
    @cat $(DEPS) > $@

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

../include/FFDecl.h: $(top_srcdir)/src/appl/ROUTINES
    (cd ../include; $(top_srcdir)/tools/GETSYMBOLS)

$(top_builddir)/bin/R.binary: $(OBJS) $(RLIBS)
    @$(MKINSTALLDIRS) $(top_builddir)/bin
    $(LDCMD) $(DLLFLAGS) -o $@ $(OBJS) $(ALL_LIBS)

$(top_builddir)/bin/R.gnome: $(OBJS) $(RGNOMELIBS)
    @$(MKINSTALLDIRS) $(top_builddir)/bin
    $(LDCMD) $(DLLFLAGS) $(GNOME_LIBDIR) -o $@ $(OBJS) $(ALL_GNOME_LIBS)

../unix/libunix.a:
    (cd ../unix;  $(MAKE) $(@F))
../appl/libappl.a:
    (cd ../appl;  $(MAKE) $(@F))
../nmath/libmath.a:
    (cd ../nmath; $(MAKE) $(@F))

gram.c: $(srcdir)/gram.y
    $(YACC) $(srcdir)/gram.y
    mv y.tab.c $@

mostlyclean: clean
clean:
    @echo "Cleaning in $(subdir)"
    @-rm -f R.binary R-Image *core Makedeps *.d *.o gram.c
distclean: clean
    @-rm -f Makefile
maintainer-clean: distclean
    @rm -f gram.c

tags: *.h *.c
    ctags *.h *.c
TAGS: *.h *.c
    etags *.h *.c

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

# Unused targets

install install-strip uninstall info dvi check::

@MAKE_INCLUDE_DEPS@ ./Makedeps