## To install ESS for all users on your unix system:
## 1. Check variables below, edit as necessary
## 2. make
## 3. make install

## Section 1
## Installation variables for your Emacs variant
##
## Variable    Description
## EMACS       Path to GNU Emacs
## EMACSBATCH  How to run Emacs as batch
## SITELISP    Destination of site-lisp
## ESSDESTDIR  Destination of ESS
DESTDIR ?= /usr
PREFIX ?= $(DESTDIR)

##__ GNU Emacs __
EMACS ?= emacs
SITELISP ?= $(PREFIX)/share/emacs/site-lisp
ESSDESTDIR ?= $(SITELISP)/ess
EMACSBATCH ?= $(EMACS) -batch -Q

# ##__ GNU Emacs __ for version 29.4 
# DESTDIR = /usr/local
# PREFIX = $(DESTDIR)
# EMACS = $(PREFIX)/emacs/29.4/bin/emacs
# SITELISP = $(PREFIX)/emacs/29.4/share/emacs/site-lisp
# ESSDESTDIR = $(SITELISP)/ess
# EMACSBATCH = $(EMACS) -batch -Q

##__ GNU Emacs __  for macOS (and see Homebrew below)
# PREFIX=/Applications/Emacs.app/Contents/Resources
# EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs
# ## standard site-lisp
# SITELISP=$(PREFIX)/site-lisp
# ## Vincent Goulet's Modified Emacs needs the following SITELISP
# ## but you might need to delete $(SITELISP)/elpa/ess-VERSION
# # SITELISP=$(PREFIX)/lisp
# LISPDIR=$(SITELISP)/ess
# ESSDESTDIR=$(LISPDIR)
# INFODIR=/usr/local/info
# ETCDIR =$(PREFIX)/etc/ess
# EMACSBATCH=$(EMACS) -batch -Q
### R provides makeinfo/texi2pdf/texi2dvi outside of the PATH 
### add the line "/opt/R/MACHINE/bin" to the file /etc/paths

##__ GNU Emacs with Homebrew __  for macOS
## site-lisp is not within .app directory
# PREFIX=/Applications/Emacs.app/Contents/Resources
# EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs
# SITELISP=/opt/homebrew/share/emacs/site-lisp
# LISPDIR=$(SITELISP)/ess
# INFODIR=/usr/local/info
# ETCDIR =$(PREFIX)/etc/ess

##__ Aquamacs __  (donated by Dan Knoepfle, Mar 26, 2011)
# PREFIX=/Applications/Aquamacs.app/Contents/Resources/lisp/aquamacs/edit-modes
# EMACS=/Applications/Aquamacs.app/Contents/MacOS/Aquamacs
# SITELISP=/Applications/Aquamacs.app/Contents/Resources/lisp
# LISPDIR=$(PREFIX)/ess-mode/lisp
# INFODIR=/Applications/Aquamacs.app/Contents/Resources/info
# ETCDIR=$(PREFIX)/ess-mode/etc

## COMPILE-FLAGS is set in tests
COMPILE ?= $(EMACSBATCH) $(COMPILE-FLAGS) --directory . --directory ./obsolete -f batch-byte-compile
COMPILE-SIMPLE ?= $(EMACSBATCH) --directory . --directory ./obsolete -f batch-byte-compile

## Section 2
## Installation variables for your unix variant
##
## Variable        Description
## MAKEINFO        program to convert .texi{nfo} to .info
## MAKEHTML        program to convert .texi{nfo} to .html
## MAKETXT         program to convert .texi{nfo} to .txt
## INSTALLDIR      to create directories, if necessary
## INSTALL         to copy files, file copying commands expect 2 args:
##                 1st) source-file & 2nd) target-directory
## UNINSTALL       deletes all arguments
## DOCDIR          Destination of other doc files
## DOWNLOAD        Download internet file to stdout

MAKEINFO ?= LC_ALL=C LANG=en makeinfo
MAKEHTML ?= $(MAKEINFO) --html --no-split --css-include=atouchofstyle.css -o
MAKETXT  ?= $(MAKEINFO) --no-validate --plaintext --no-split -o -
INSTALLDIR ?= mkdir -p
INSTALL ?= cp -p
UNINSTALL ?= rm -f
TEXI2PDF ?= LANG=C texi2dvi --pdf
DOWNLOAD ?= $(shell which wget > /dev/null && echo 'wget -qO -' || which curl)
INSTALLINFO ?= install-info

## Section 3
## For ESS developers only, not part of installation procedure
##
## Variable        Description
## GNUTAR          the name of GNU tar to support the z option
## SVN_URL         SVN repository URL (repo retired)
## UPLOAD_DIR      Martin's upload directory
## ESS_HOMEPAGE    Martin's svn co https://svn.r-project.org/ESS-web/trunk
##

GNUTAR=tar
# SVN_URL = https://svn.r-project.org/ESS
UPLOAD_DIR = /u/maechler/emacs/ess-WWW/downloads/ess
ESS_HOMEPAGE = /u/maechler/emacs/ESS-web

GPG=$(shell (gpg2 --version > /dev/null 2>&1 && echo gpg2 ) || echo gpg )

.SUFFIXES: .i3 .m3 .nw .tex .dvi .html .c .h .el .elc

# Local Variables:
# mode: makefile-gmake
# End:
