Use more variables

This allows any command used to be overridden, when, for example,
they're not installed in PATH.
This commit is contained in:
Tom Willemsen 2013-01-06 15:52:33 +01:00
parent e2999eed45
commit 4fde21d991
4 changed files with 23 additions and 15 deletions

View file

@ -1,4 +1,8 @@
INSTALL = install -D
export DESTDIR ?= /usr/local export DESTDIR ?= /usr/local
export INSTALL_PROGRAM = $(INSTALL)
export INSTALL_DATA = $(INSTALL) -m 644
dirs = src doc conkeror dirs = src doc conkeror
install-dirs = $(addprefix install-,$(dirs)) install-dirs = $(addprefix install-,$(dirs))

View file

@ -4,7 +4,7 @@ DESTDIR ?= /usr/local
all: all:
install: markam.js install: markam.js
install -Dm 655 markam.js \ $(INSTALL_DATA) markam.js \
"$(DESTDIR)/share/conkeror/modules/markam.js" "$(DESTDIR)/share/conkeror/modules/markam.js"
uninstall: uninstall:

View file

@ -1,4 +1,7 @@
DESTDIR ?= /usr/local DESTDIR ?= /usr/local
INSTALL_INFO = install-info
TEXI2PDF = texi2pdf
DVIPS = dvips
.PHONY: all html dvi pdf ps install uninstall install-dvi install-pdf \ .PHONY: all html dvi pdf ps install uninstall install-dvi install-pdf \
install-ps install-ps
@ -6,12 +9,12 @@ DESTDIR ?= /usr/local
all: markam.info all: markam.info
install: markam.info install: markam.info
install -Dm 655 markam.info "$(DESTDIR)/share/info/markam.info" $(INSTALL_DATA) markam.info "$(DESTDIR)/share/info/markam.info"
install-info --dir-file="$(DESTDIR)/share/info/dir" \ $(INSTALL_INFO) --dir-file="$(DESTDIR)/share/info/dir" \
"$(DESTDIR)/share/info/markam.info" "$(DESTDIR)/share/info/markam.info"
uninstall: uninstall:
install-info --dir-file="$(DESTDIR)/share/info/dir" \ $(INSTALL_INFO) --dir-file="$(DESTDIR)/share/info/dir" \
--delete "$(DESTDIR)/share/info/markam.info" --delete "$(DESTDIR)/share/info/markam.info"
rm -f "$(DESTDIR)/share/info/markam.info" rm -f "$(DESTDIR)/share/info/markam.info"
rm -f "$(DESTDIR)/share/doc/markam/dvi/markam.dvi" rm -f "$(DESTDIR)/share/doc/markam/dvi/markam.dvi"
@ -20,31 +23,31 @@ uninstall:
rm -rf "$(DESTDIR)/share/doc/markam/html/" rm -rf "$(DESTDIR)/share/doc/markam/html/"
install-dvi: markam.dvi install-dvi: markam.dvi
install -Dm 655 markam.dvi \ $(INSTALL_DATA) markam.dvi \
"$(DESTDIR)/share/doc/markam/dvi/markam.dvi" "$(DESTDIR)/share/doc/markam/dvi/markam.dvi"
install-pdf: markam.pdf install-pdf: markam.pdf
install -Dm 655 markam.pdf \ $(INSTALL_DATA) markam.pdf \
"$(DESTDIR)/share/doc/markam/pdf/markam.pdf" "$(DESTDIR)/share/doc/markam/pdf/markam.pdf"
install-ps: markam.ps install-ps: markam.ps
install -Dm 655 markam.ps \ $(INSTALL_DATA) markam.ps \
"$(DESTDIR)/share/doc/markam/ps/markam.ps" "$(DESTDIR)/share/doc/markam/ps/markam.ps"
markam.info: markam.texi markam.info: markam.texi
html: markam.texi html: markam.texi
makeinfo --html markam.texi -o html $(MAKEINFO) --html markam.texi -o html
dvi: markam.dvi dvi: markam.dvi
pdf: markam.pdf pdf: markam.pdf
ps: markam.ps ps: markam.ps
markam.dvi: markam.texi markam.dvi: markam.texi
texi2dvi markam.texi $(TEXI2DVI) markam.texi
markam.pdf: markam.texi markam.pdf: markam.texi
texi2pdf markam.texi $(TEXI2PDF) markam.texi
markam.ps: markam.dvi markam.ps: markam.dvi
dvips markam.dvi $(DVIPS) markam.dvi

View file

@ -1,4 +1,5 @@
DESTDIR ?= /usr/local DESTDIR ?= /usr/local
CSC = csc
binaries = markam markam-convert binaries = markam markam-convert
install-binaries = $(addprefix install-,$(binaries)) install-binaries = $(addprefix install-,$(binaries))
@ -12,16 +13,16 @@ install: $(install-binaries)
uninstall: $(uninstall-binaries) uninstall: $(uninstall-binaries)
markam: markam.scm $(objects) markam: markam.scm $(objects)
csc $^ -o $@ $(CSC) $^ -o $@
markam-convert: markam-convert.scm $(objects) markam-convert: markam-convert.scm $(objects)
csc $^ -o $@ $(CSC) $^ -o $@
$(install-binaries): install-%: % $(install-binaries): install-%: %
install -Dm 755 $* "$(DESTDIR)/bin/$*" $(INSTALL_PROGRAM) $* "$(DESTDIR)/bin/$*"
$(uninstall-binaries): uninstall-%: $(uninstall-binaries): uninstall-%:
rm -f "$(DESTDIR)/bin/$*" rm -f "$(DESTDIR)/bin/$*"
$(objects): %.o: %.scm $(objects): %.o: %.scm
csc -c $^ $(CSC) -c $^