diff options
author | roktas <roktas@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2006-11-03 11:26:53 +0000 |
---|---|---|
committer | roktas <roktas@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2006-11-03 11:26:53 +0000 |
commit | afd92376d6bd2380216a5f1a56eb8b81093b2a54 (patch) | |
tree | 355b6eca250d51bc44dc3dcf6f327a426c6ab10d /Makefile | |
parent | fdfe8494ca162508850455c0b0cbce6fac905ab8 (diff) | |
download | pandoc-afd92376d6bd2380216a5f1a56eb8b81093b2a54.tar.gz |
Attempt to fix a (long-standing) Makefile drawback which is documented in
previous revisions as follows:
# XXX: Note that we don't handle PREFIX correctly at the install-*
# stages, i.e. any PREFIX given at the configuration time is lost,
# unless it is also supplied (via environment) at these stages.
With this (optional and experimental) hack, config time settings will
become persistent. Such persistency allows one to specify PREFIX and/or
DESTDIR only once (at the first run). That is, the below actions should
work fine now:
DESTDIR=/tmp/foo make
make install
In previous code these variables need to be specified at each run. For
example:
DESTDIR=/tmp/foo make
DESTDIR=/tmp/foo make install
This change (as an ugly hack) is optional (and might be removed) as the
user could always work around that issue with 'DESTDIR=/tmp/foo make
install'.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@75 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 29 |
1 files changed, 18 insertions, 11 deletions
@@ -19,12 +19,6 @@ PROGS := $(EXECS) html2markdown markdown2html latex2markdown markdown2latex DOCS := README.html README BUGS TODO #------------------------------------------------------------------------------- -# Variables to setup through environment -#------------------------------------------------------------------------------- -PREFIX ?= /usr/local -DESTDIR ?= - -#------------------------------------------------------------------------------- # Constant names and commands in source tree #------------------------------------------------------------------------------- SRCDIR := src @@ -32,9 +26,23 @@ MANDIR := man BUILDDIR := dist BUILDCONF := .setup-config BUILDCMD := runhaskell Setup.hs +BUILDVARS := vars CONFIGURE := configure #------------------------------------------------------------------------------- +# Variables to setup through environment +#------------------------------------------------------------------------------- + +# Specify default values. +prefix := /usr/local +destdir := +# Attempt to set variables from a previous make session. +-include $(BUILDVARS) +# Fallback to defaults but allow to get the values from environment. +PREFIX ?= $(prefix) +DESTDIR ?= $(destdir) + +#------------------------------------------------------------------------------- # Installation paths #------------------------------------------------------------------------------- THIS := $(shell echo $(NAME) | tr A-Z a-z) @@ -85,10 +93,13 @@ $(CABAL): cabalize $(CABAL).in ./cabalize <$(CABAL).in >$(CABAL) .PHONY: configure -cleanup_files+=$(BUILDDIR) $(BUILDCONF) +cleanup_files+=$(BUILDDIR) $(BUILDCONF) $(BUILDVARS) configure: $(BUILDCONF) $(BUILDCONF): $(CABAL) $(BUILDCMD) configure --prefix=$(PREFIX) + # Make configuration time settings persistent (definitely a hack). + @echo "PREFIX?=$(PREFIX)" >$(BUILDVARS) + @echo "DESTDIR?=$(DESTDIR)" >>$(BUILDVARS) .PHONY: build build: $(BUILDDIR) @@ -121,10 +132,6 @@ html/: configure .PHONY: build-all build-all: all build-lib-doc -# XXX: Note that we don't handle PREFIX correctly at the install-* stages, -# i.e. any PREFIX given at the configuration time is lost, unless it is -# also supplied (via environment) at these stages. - # User documents installation. .PHONY: install-doc uninstall-doc man_all:=$(patsubst $(MANDIR)/%,%,$(wildcard $(MANDIR)/man?/*.1)) |