The R Project SVN R

Rev

Rev 89323 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
30054 ripley 1
#-*- Makefile -*-
2
include ../gnuwin32/MkRules
67610 ripley 3
R_HOME = ../..
30054 ripley 4
 
67641 maechler 5
GIT = `if [ -d "$(top_builddir)/.git" ]; then echo "git"; fi`
67638 maechler 6
 
67610 ripley 7
VER = $(shell sed -e 's/\([^ ]*\).*/\1/' ../../VERSION)
43390 ripley 8
 
83497 kalibera 9
CC_VER=$(shell $(CC) --version | ${SED} -n 1p)
10
FC_VER=$(shell $(FC) --version | ${SED} -n 1p)
11
 
30054 ripley 12
## keep these in step with ./Makefile.in
81984 kalibera 13
SRC_HEADERS = R.h Rdefines.h Rembedded.h Rinternals.h
31538 ripley 14
## this deliberately does not include Rinterfaces.h, which is Unix-only
30054 ripley 15
OBJ_HEADERS = Rconfig.h Rmath.h Rversion.h
46436 ripley 16
GW32_HEADERS = iconv.h psignal.h
30054 ripley 17
 
89100 luke 18
## This omits GetX11Image.h QuartzDevice.h eventloop.h
71512 ripley 19
R_EXT_HEADERS = \
89696 luke 20
  Altrep.h Applic.h Arith.h BLAS.h Boolean.h Callbacks.h Complex.h \
74713 luke 21
  Connections.h Constants.h Error.h \
71512 ripley 22
  GraphicsDevice.h GraphicsEngine.h Itermacros.h \
23
  Lapack.h Linpack.h MathThreads.h Memory.h \
89323 luke 24
  Parse.h Print.h RS.h Rallocators.h Random.h \
71512 ripley 25
  Rdynload.h Riconv.h RStartup.h Utils.h libextern.h \
89101 luke 26
  stats_package.h stats_stubs.h Visibility.h ObjectTable.h
71512 ripley 27
 
67837 murdoch 28
all: fixh config.h trioremap.h
30054 ripley 29
	@echo 'installing C headers'
30
	@mkdir -p $(R_HOME)/include/R_ext
46407 ripley 31
	@cp -p $(SRC_HEADERS) $(OBJ_HEADERS) iconv.h $(R_HOME)/include
71524 ligges 32
	@(cd R_ext; cp -p $(R_EXT_HEADERS) ../../../include/R_ext)
42521 ripley 33
	@cp -p ../extra/graphapp/graphapp.h ../extra/graphapp/ga.h \
30077 ripley 34
	  $(R_HOME)/include
30054 ripley 35
 
36
version: Rversion.h
37
 
46407 ripley 38
fixh: $(GW32_HEADERS) $(OBJ_HEADERS)
30054 ripley 39
	@$(ECHO) done > fixh
40
 
83497 kalibera 41
config.h: ../gnuwin32/fixed/h/config.h ../../VERSION
84980 kalibera 42
	@$(SED) -e 's/@VERSION@/$(VER)/' \
83497 kalibera 43
                -e 's/@CC_VER@/$(CC_VER)/' -e 's/@FC_VER@/$(FC_VER)/' $< > $@
44
 
61352 ripley 45
Rconfig.h: ../gnuwin32/fixed/h/Rconfig.h
46
	@cp $< $@
47
 
32482 ripley 48
iconv.h: ../gnuwin32/fixed/h/iconv.h
49
	@cp $< $@
50
 
30074 ripley 51
psignal.h: ../gnuwin32/fixed/h/psignal.h
52
	@cp $< $@
35017 ripley 53
 
34560 ripley 54
Rversion.h: $(R_HOME)/VERSION $(R_HOME)/SVN-REVISION $(R_HOME)/tools/GETVERSION
46835 ripley 55
	@sh $(R_HOME)/tools/GETVERSION > $@
30054 ripley 56
 
54768 ripley 57
Rmath.h0: Rmath.h0.in $(R_HOME)/VERSION Makefile.win
74324 ripley 58
	@$(SED) \
30054 ripley 59
	  -e  's/@RMATH_HAVE_WORKING_LOG1P@/# define HAVE_WORKING_LOG1P 1/' \
60
	  -e "s/@PACKAGE_VERSION@/`sed 's/\([^ ]*\).*/\1/' < $(R_HOME)/VERSION`/" $< > Rmath.h0
61
 
62
Rmath.h: Rmath.h0
63
	@sh $(R_HOME)/tools/copy-if-change $< $@
71512 ripley 64
 
67837 murdoch 65
trioremap.h: ../gnuwin32/fixed/h/trioremap.h
66
	@cp $< $@
34417 ripley 67
 
68
## If we do not have svn, get the old file from SVN-REVISION.bak (if poss).
69
## This needs to be copy-on-change.
39448 ripley 70
## The date from svn info is not in GMT, but we have decided to live
71
## with that as they changed the format in svn 1.4.x
34417 ripley 72
## <FIXME> USE_SVNVERSION does not work if there is no 'svnversion'
34418 ripley 73
FORCE:
74
$(R_HOME)/SVN-REVISION: FORCE
37052 ripley 75
	@if test -f  $(R_HOME)/SVN-REVISION ; then \
76
	  cp -p $(R_HOME)/SVN-REVISION $(R_HOME)/SVN-REVISION.bak ; \
77
	fi
34408 murdoch 78
ifdef USE_SVNVERSION
36904 ripley 79
	@LC_ALL=C svnversion ../.. | sed -n 's/^/Revision: /p' > svn-tmp || rm -f svn-tmp
34408 murdoch 80
	@grep -v exported svn-tmp > /dev/null || rm -f svn-tmp
81
else
67638 maechler 82
	@(cd ../..; LC_ALL=C $(GIT) svn info || echo "Revision: unknown") 2> /dev/null \
34417 ripley 83
	  | sed -n '/^Revision/p' > svn-tmp
84
	@if grep unknown svn-tmp > /dev/null ; then \
85
	  rm svn-tmp; \
86
	fi
34408 murdoch 87
endif
39448 ripley 88
	@if test -f svn-tmp ; then \
67638 maechler 89
	  (cd ../..; LC_ALL=C TZ=GMT $(GIT) svn info || echo "Last Changed Date: unknown") 2> /dev/null \
39448 ripley 90
	    | sed -n '/^Last Changed Date:/p' | sed 's/[0-9][0-9]:.*//' \
91
	    >> svn-tmp ; \
34417 ripley 92
	else \
93
	  rm -f svn-tmp ; \
94
	fi
34408 murdoch 95
	@if test -f svn-tmp; then \
34417 ripley 96
	  if test ! -f $@ || ! cmp svn-tmp $@ > /dev/null ; then\
97
	    cp svn-tmp $@; \
98
	  fi ; \
34408 murdoch 99
	else \
35017 ripley 100
	  cp -p $(R_HOME)/SVN-REVISION.bak $@ 2> /dev/null || \
35041 murdoch 101
	  (echo "Revision: 00000" > $@; \
39448 ripley 102
	   echo "Last Changed Date: 2006-00-00" >> $@) ; \
34408 murdoch 103
	fi 
104
	@rm -f svn-tmp $(R_HOME)/SVN-REVISION.bak
30054 ripley 105
 
106
distclean:
107
	$(RM) -f Rmath.h0 fixh