diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-11-27 13:10:29 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-11-27 13:10:29 +0100 |
commit | 7ee4dc372cbb0b273ea4bfba026ad0f0e35266d3 (patch) | |
tree | 6e1f8abc4c9ed18f1d9aa2f941a9e61ae62bc5f9 | |
parent | fix dist (diff) | |
download | bfind-7ee4dc372cbb0b273ea4bfba026ad0f0e35266d3.tar.gz bfind-7ee4dc372cbb0b273ea4bfba026ad0f0e35266d3.tar.bz2 bfind-7ee4dc372cbb0b273ea4bfba026ad0f0e35266d3.tar.xz |
improve makefile
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | COPYING | 2 | ||||
-rw-r--r-- | Makefile | 120 | ||||
-rw-r--r-- | doc/info/bfind.texinfo (renamed from info/bfind.texinfo) | 0 | ||||
-rw-r--r-- | doc/info/fdl.texinfo (renamed from info/fdl.texinfo) | 0 |
5 files changed, 90 insertions, 34 deletions
@@ -1,4 +1,6 @@ _/ +/bin/ +/obj/ __pycache__/ \#*\# .* @@ -1,6 +1,6 @@ bfind – Minimalitic `find` using breadth first crawling -Copyright © 2013 Mattias Andrée (maandree@member.fsf.org) +Copyright © 2013, 2015 Mattias Andrée (maandree@member.fsf.org) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1,37 +1,71 @@ PREFIX = /usr BIN = /bin DATA = /share -LICENSES = $(DATA)/licenses +BINDIR = $(PREFIX)/bin +DATADIR = $(PREFIX)/share +INFODIR = $(DATADIR)/info +DOCDIR = $(DATADIR)/doc +LICENSEDIR = $(DATADIR)/licenses + COMMAND = bfind PKGNAME = bfind -PY3_SHEBANG = /usr/bin/env/ python3 +PY3_SHEBANG = /usr/bin/env python3 + +.PHONY: default +default: cmd info + .PHONY: all all: cmd doc .PHONY: cmd -cmd: bfind +cmd: bin/bfind + +bin/bfind: src/bfind.py + @mkdir -p bin + cp $< $@ + sed -i 's:/usr/bin/env/ python3:$(PY3_SHEBANG):' "$@" .PHONY: doc -doc: info +doc: info pdf dvi ps .PHONY: info -info: bfind.info.gz - -%.info.gz: info/%.texinfo.install - makeinfo "$<" - gzip -9 -f "$*.info" - -info/%.texinfo.install: info/%.texinfo - cp "$<" "$@" - sed -i 's:^@set COMMAND bfind:@set COMMAND $(COMMAND):g' "$@" - -bfind: src/bfind.py - cp "$<" "$@" - sed -i 's:/usr/bin/env/ python3:$(PY3_SHEBANG):' "$@" - +info: bin/bfind.info +bin/%.info: doc/info/%.texinfo + @mkdir -p bin + $(MAKEINFO) $< + mv $*.info $@ + +.PHONY: pdf +pdf: bin/bfind.pdf +bin/%.pdf: doc/info/%.texinfo + @! test -d obj/pdf || rm -rf obj/pdf + @mkdir -p bin obj/pdf + cd obj/pdf && texi2pdf ../../"$<" < /dev/null + mv obj/pdf/$*.pdf $@ + +.PHONY: dvi +dvi: bin/bfind.dvi +bin/%.dvi: doc/info/%.texinfo + @! test -d obj/dvi || rm -rf obj/dvi + @mkdir -p bin obj/dvi + cd obj/dvi && $(TEXI2DVI) ../../"$<" < /dev/null + mv obj/dvi/$*.dvi $@ + +.PHONY: ps +ps: bin/bfind.ps +bin/%.ps: doc/info/%.texinfo + @! test -d obj/ps || rm -rf obj/ps + @mkdir -p bin obj/ps + cd obj/ps && texi2pdf --ps ../../"$<" < /dev/null + mv obj/ps/$*.ps $@ + + + +.PHONY: install-default +install-default: install-core install-info .PHONY: install install: install-core install-doc @@ -40,34 +74,54 @@ install: install-core install-doc install-core: install-cmd install-license .PHONY: install-cmd -install-cmd: bfind - install -d -- "$(DESTDIR)$(PREFIX)$(BIN)" - install -m755 -- bfind "$(DESTDIR)$(PREFIX)$(BIN)/$(COMMAND)" +install-cmd: bin/bfind + install -dm755 -- "$(DESTDIR)$(BINDIR)" + install -m755 -- $< "$(DESTDIR)$(BINDIR)/$(COMMAND)" .PHONY: install-license install-license: - install -d -- "$(DESTDIR)$(PREFIX)$(LICENSES)/$(PKGNAME)" - install -m644 -- COPYING LICENSE "$(DESTDIR)$(PREFIX)$(LICENSES)/$(PKGNAME)" + install -dm755 -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)" + install -m644 -- COPYING LICENSE "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)" .PHONY: install-doc -install-doc: install-info +install-doc: install-info install-pdf install-dvi install-ps .PHONY: install-info -install-info: bfind.info.gz - install -dm755 -- "$(DESTDIR)$(PREFIX)$(DATA)/info" - install -m644 bfind.info.gz -- "$(DESTDIR)$(PREFIX)$(DATA)/info/$(PKGNAME).info.gz" +install-info: bin/bfind.info + install -dm755 -- "$(DESTDIR)$(INFODIR)" + install -m644 $< -- "$(DESTDIR)$(INFODIR)/$(PKGNAME).info" + +.PHONY: install-pdf +install-pdf: bin/bfind.pdf + install -dm755 -- "$(DESTDIR)$(DOCDIR)" + install -m644 $< -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME).pdf" + +.PHONY: install-dvi +install-dvi: bin/bfind.dvi + install -dm755 -- "$(DESTDIR)$(DOCDIR)" + install -m644 $< -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME).dvi" + +.PHONY: install-ps +install-ps: bin/bfind.ps + install -dm755 -- "$(DESTDIR)$(DOCDIR)" + install -m644 $< -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME).ps" + .PHONY: uninstall uninstall: - -rm -- "$(DESTDIR)$(PREFIX)$(BIN)/$(COMMAND)" - -rm -- "$(DESTDIR)$(PREFIX)$(LICENSES)/$(PKGNAME)/COPYING" - -rm -- "$(DESTDIR)$(PREFIX)$(LICENSES)/$(PKGNAME)/LICENSE" - -rm -d -- "$(DESTDIR)$(PREFIX)$(LICENSES)/$(PKGNAME)" - -rm -- "$(DESTDIR)$(PREFIX)$(DATA)/info/$(PKGNAME).info.gz" + -rm -- "$(DESTDIR)$(BINDIR)/$(COMMAND)" + -rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/COPYING" + -rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/LICENSE" + -rmdir -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)" + -rm -- "$(DESTDIR)$(INFODIR)/$(PKGNAME).info" + -rm -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME).pdf" + -rm -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME).dvi" + -rm -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME).ps" + .PHONY: clean clean: - -rm -- bfind bfind.info.gz info/*.install + -rm -r obj bin diff --git a/info/bfind.texinfo b/doc/info/bfind.texinfo index 203c6ff..203c6ff 100644 --- a/info/bfind.texinfo +++ b/doc/info/bfind.texinfo diff --git a/info/fdl.texinfo b/doc/info/fdl.texinfo index cb71f05..cb71f05 100644 --- a/info/fdl.texinfo +++ b/doc/info/fdl.texinfo |