The R Project SVN R

Rev

Rev 3982 | Rev 4760 | 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])

OBJS = arithmetic.o array.o attrib.o bind.o builtin.o character.o       \
    coerce.o colors.o complex.o context.o cov.o cum.o debug.o       \
    deparse.o deriv.o devices.o dotcode.o dstruct.o duplicate.o     \
    envir.o errors.o eval.o format.o fourier.o gram.o gram-ex.o graphics.o    \
    iosupport.o list.o logic.o main.o match.o memory.o model.o      \
    names.o objects.o optimize.o options.o par.o paste.o platform.o \
    plot.o plot3d.o plotmath.o print.o printarray.o printvector.o   \
    printutils.o random.o relop.o saveload.o scan.o seq.o sort.o    \
    source.o split.o subassign.o subscript.o subset.o summary.o     \
    unique.o util.o version.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 $(top_builddir)/bin/R.binary @RGNOMEBIN@

$(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))

$(OBJS): $(top_srcdir)/src/include/Defn.h

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

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

mostlyclean: clean
clean:
    @-rm -f R.binary R-Image *core *.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

# Dependencies

colors.o:   $(top_srcdir)/src/include/Graphics.h
graphics.o: $(top_srcdir)/src/include/Graphics.h
par.o:      $(top_srcdir)/src/include/Graphics.h
plot.o:     $(top_srcdir)/src/include/Graphics.h

arithmetic.o:   $(top_srcdir)/src/include/Mathlib.h
format.o:   $(top_srcdir)/src/include/Mathlib.h
random.o:   $(top_srcdir)/src/include/Mathlib.h \
            $(top_srcdir)/src/include/Random.h

deparse.o:  names.h
names.o:    names.h

print.o:    $(top_srcdir)/src/include/Print.h
printarray.o:   $(top_srcdir)/src/include/Print.h
printutils.o:   $(top_srcdir)/src/include/Print.h
printvector.o:  $(top_srcdir)/src/include/Print.h

version.o:  ../include/Platform.h
../include/Platform.h:
    (cd ../include; $(MAKE) Platform.h)

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::