diff --git a/Makefile b/Makefile index 4666695..bac58a5 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,8 @@ +INSTALL = install -D + export DESTDIR ?= /usr/local +export INSTALL_PROGRAM = $(INSTALL) +export INSTALL_DATA = $(INSTALL) -m 644 dirs = src doc conkeror install-dirs = $(addprefix install-,$(dirs)) diff --git a/conkeror/Makefile b/conkeror/Makefile index 25ffd14..5d21926 100644 --- a/conkeror/Makefile +++ b/conkeror/Makefile @@ -4,7 +4,7 @@ DESTDIR ?= /usr/local all: install: markam.js - install -Dm 655 markam.js \ + $(INSTALL_DATA) markam.js \ "$(DESTDIR)/share/conkeror/modules/markam.js" uninstall: diff --git a/doc/Makefile b/doc/Makefile index dbea1f8..36b33c4 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,4 +1,7 @@ DESTDIR ?= /usr/local +INSTALL_INFO = install-info +TEXI2PDF = texi2pdf +DVIPS = dvips .PHONY: all html dvi pdf ps install uninstall install-dvi install-pdf \ install-ps @@ -6,12 +9,12 @@ DESTDIR ?= /usr/local all: markam.info install: markam.info - install -Dm 655 markam.info "$(DESTDIR)/share/info/markam.info" - install-info --dir-file="$(DESTDIR)/share/info/dir" \ + $(INSTALL_DATA) markam.info "$(DESTDIR)/share/info/markam.info" + $(INSTALL_INFO) --dir-file="$(DESTDIR)/share/info/dir" \ "$(DESTDIR)/share/info/markam.info" uninstall: - install-info --dir-file="$(DESTDIR)/share/info/dir" \ + $(INSTALL_INFO) --dir-file="$(DESTDIR)/share/info/dir" \ --delete "$(DESTDIR)/share/info/markam.info" rm -f "$(DESTDIR)/share/info/markam.info" rm -f "$(DESTDIR)/share/doc/markam/dvi/markam.dvi" @@ -20,31 +23,31 @@ uninstall: rm -rf "$(DESTDIR)/share/doc/markam/html/" install-dvi: markam.dvi - install -Dm 655 markam.dvi \ + $(INSTALL_DATA) markam.dvi \ "$(DESTDIR)/share/doc/markam/dvi/markam.dvi" install-pdf: markam.pdf - install -Dm 655 markam.pdf \ + $(INSTALL_DATA) markam.pdf \ "$(DESTDIR)/share/doc/markam/pdf/markam.pdf" install-ps: markam.ps - install -Dm 655 markam.ps \ + $(INSTALL_DATA) markam.ps \ "$(DESTDIR)/share/doc/markam/ps/markam.ps" markam.info: markam.texi html: markam.texi - makeinfo --html markam.texi -o html + $(MAKEINFO) --html markam.texi -o html dvi: markam.dvi pdf: markam.pdf ps: markam.ps markam.dvi: markam.texi - texi2dvi markam.texi + $(TEXI2DVI) markam.texi markam.pdf: markam.texi - texi2pdf markam.texi + $(TEXI2PDF) markam.texi markam.ps: markam.dvi - dvips markam.dvi + $(DVIPS) markam.dvi diff --git a/src/Makefile b/src/Makefile index 961ad1b..a7d2415 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,4 +1,5 @@ DESTDIR ?= /usr/local +CSC = csc binaries = markam markam-convert install-binaries = $(addprefix install-,$(binaries)) @@ -12,16 +13,16 @@ install: $(install-binaries) uninstall: $(uninstall-binaries) markam: markam.scm $(objects) - csc $^ -o $@ + $(CSC) $^ -o $@ markam-convert: markam-convert.scm $(objects) - csc $^ -o $@ + $(CSC) $^ -o $@ $(install-binaries): install-%: % - install -Dm 755 $* "$(DESTDIR)/bin/$*" + $(INSTALL_PROGRAM) $* "$(DESTDIR)/bin/$*" $(uninstall-binaries): uninstall-%: rm -f "$(DESTDIR)/bin/$*" $(objects): %.o: %.scm - csc -c $^ + $(CSC) -c $^