#-*- Makefile -*- include ../gnuwin32/MkRules R_HOME=../.. ## keep these in step with ./Makefile.in SRC_HEADERS = R.h S.h Rdefines.h Rdevices.h Rembedded.h Rgraphics.h \ Rinternals.h ## this deliberately does not include Rinterfaces.h, which is Unix-only OBJ_HEADERS = Rconfig.h Rmath.h Rversion.h GW32_HEADERS = config.h psignal.h RPROXY_HEADERS = SC_proxy.h SC_system.h rproxy.h bdx.h bdx_SEXP.h bdx_com.h bdx_util.h com_util.h all: fixh @echo 'installing C headers' @mkdir -p $(R_HOME)/include/R_ext @cp -p $(SRC_HEADERS) $(OBJ_HEADERS) $(RPROXY_HEADERS) $(R_HOME)/include @cp -p R_ext/*.h $(R_HOME)/include/R_ext @cp -p ../gnuwin32/graphapp/graphapp.h ../gnuwin32/graphapp/ga.h \ $(R_HOME)/include version: Rversion.h fixh: $(GW32_HEADERS) $(OBJ_HEADERS) $(RPROXY_HEADERS) @$(ECHO) done > fixh config.h: ../gnuwin32/fixed/h/config.h @cp $< $@ iconv.h: ../gnuwin32/fixed/h/iconv.h @cp $< $@ psignal.h: ../gnuwin32/fixed/h/psignal.h @cp $< $@ SC_proxy.h: ../gnuwin32/front-ends/SC_proxy.h @cp $< $@ SC_system.h: ../gnuwin32/front-ends/SC_system.h @cp $< $@ rproxy.h: ../gnuwin32/front-ends/rproxy.h @cp $< $@ bdx.h: ../gnuwin32/front-ends/bdx.h @cp $< $@ bdx_SEXP.h: ../gnuwin32/front-ends/bdx_SEXP.h @cp $< $@ bdx_com.h: ../gnuwin32/front-ends/bdx_com.h @cp $< $@ bdx_util.h: ../gnuwin32/front-ends/bdx_util.h @cp $< $@ com_util.h: ../gnuwin32/front-ends/com_util.h @cp $< $@ Rconfig.h: config.h $(R_HOME)/tools/GETCONFIG @$(SED) -e 1d $(R_HOME)/tools/GETCONFIG > GC @sh GC > Rconfig.h @$(RM) GC Rversion.h: $(R_HOME)/VERSION $(R_HOME)/SVN-REVISION $(R_HOME)/tools/GETVERSION @$(SED) -e 1d $(R_HOME)/tools/GETVERSION > $(R_HOME)/tools/GV @sh $(R_HOME)/tools/GV > $@ @$(RM) $(R_HOME)/tools/GV Rmath.h0: Rmath.h0.in $(R_HOME)/VERSION @$(SED) -e 's/@RMATH_HAVE_LOG1P@/# define HAVE_LOG1P 1/' \ -e /@RMATH_HAVE_EXPM1@/d \ -e 's/@RMATH_HAVE_WORKING_LOG1P@/# define HAVE_WORKING_LOG1P 1/' \ -e 's/@RMATH_HAVE_WORKING_LOG@/# define HAVE_WORKING_LOG 1/' \ -e "s/@PACKAGE_VERSION@/`sed 's/\([^ ]*\).*/\1/' < $(R_HOME)/VERSION`/" $< > Rmath.h0 Rmath.h: Rmath.h0 @sh $(R_HOME)/tools/copy-if-change $< $@ ## If we do not have svn, get the old file from SVN-REVISION.bak (if poss). ## This needs to be copy-on-change. ## We don't get the date from svn info as it is not in GMT. ## USE_SVNVERSION does not work if there is no 'svnversion' FORCE: $(R_HOME)/SVN-REVISION: FORCE @if test -f $(R_HOME)/SVN-REVISION ; then \ cp -p $(R_HOME)/SVN-REVISION $(R_HOME)/SVN-REVISION.bak ; \ fi ifdef USE_SVNVERSION @LC_ALL=C svnversion ../.. | sed -n 's/^/Revision: /p' > svn-tmp || rm -f svn-tmp @grep -v exported svn-tmp > /dev/null || rm -f svn-tmp else @(cd ../..; LC_ALL=C svn info || echo "Revision: unknown") 2> /dev/null \ | sed -n '/^Revision/p' > svn-tmp @if grep unknown svn-tmp > /dev/null ; then \ rm svn-tmp; \ fi endif @if test -f svn-tmp && test -f "../../.svn/entries" ; then \ cdate=`grep committed-date "../../.svn/entries" | sed -n 1p | sed -e 's/^ *committed-date=\"//' -e 's/T.*//'` ; \ echo "Last Changed Date: $${cdate}" >> svn-tmp ; \ else \ rm -f svn-tmp ; \ fi @if test -f svn-tmp; then \ if test ! -f $@ || ! cmp svn-tmp $@ > /dev/null ; then\ cp svn-tmp $@; \ fi ; \ else \ cp -p $(R_HOME)/SVN-REVISION.bak $@ 2> /dev/null || \ (echo "Revision: 00000" > $@; \ echo "Last Changed Date: 2005-00-00" >> $@) ; \ fi @rm -f svn-tmp $(R_HOME)/SVN-REVISION.bak distclean: $(RM) -f Rmath.h0 fixh $(RM) $(RPROXY_HEADERS)