The R Project SVN R

Rev

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