aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.gitignore9
-rw-r--r--Makefile148
2 files changed, 119 insertions, 38 deletions
diff --git a/.gitignore b/.gitignore
index d90dcfa..46e6d89 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,7 @@ __pycache__/
\#*\#
.*
!.git*
+*
*.bak
*.swp
*.swo
@@ -14,6 +15,8 @@ __pycache__/
*.gz
*.bz2
*.xz
-*~
-splashtool.*
-!splashtool.texinfo
+*.info
+*.pdf
+*.dvi
+*.ps
+
diff --git a/Makefile b/Makefile
index 391d911..016ae63 100644
--- a/Makefile
+++ b/Makefile
@@ -1,56 +1,134 @@
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved. This file is offered as-is,
+# without any warranty.
+
+
PREFIX = /usr
BIN = /bin
-PKGNAME = splashtool
LIBEXEC = /libexec/$(PKGNAME)
DATA = /share
-LICENSES = $(PREFIX)$(DATA)/licenses
-
-
-all: classes doc
-
+BINDIR = $(PREFIX)$(BIN)
+LIBEXECDIR = $(PREFIX)$(LIBEXEC)
+DATADIR = $(PREFIX)$(DATA)
+DOCDIR = $(DATADIR)/doc
+INFODIR = $(DATADIR)/info
+LICENSEDIR = $(DATADIR)/licenses
+SYSCONFDIR = /etc
+PROCDIR = /proc
+DEVDIR = /dev
+TMPDIR = /tmp
-doc: info
+PKGNAME = splashtool
-info: splashtool.info.gz
-%.info.gz: info/%.texinfo
- makeinfo "$<"
- gzip -9 -f "$*.info"
+.PHONY: default
+default: command info
-classes: bin/Assemble.class
+.PHONY: all
+all: command doc
+.PHONY: command
+command: bin/Assemble.class
bin/Assemble.class: src/Assemble.java
mkdir -p bin
javac -cp src -s src -d bin -encoding UTF-8 src/Assemble.java
+.PHONY: doc
+doc: info pdf ps dvi
+
+.PHONY: info
+info: splashtool.info
+%.info: info/%.texinfo info/fdl.texinfo
+ makeinfo $<
+
+.PHONY: pdf
+pdf: splashtool.pdf
+%.pdf: info/%.texinfo info/fdl.texinfo
+ @mkdir -p obj
+ cd obj && yes X | texi2pdf ../$<
+ mv obj/$@ $@
+
+.PHONY: dvi
+dvi: splashtool.dvi
+%.dvi: info/%.texinfo info/fdl.texinfo
+ @mkdir -p obj
+ cd obj && yes X | $(TEXI2DVI) ../$<
+ mv obj/$@ $@
+
+.PHONY: ps
+ps: splashtool.ps
+%.ps: info/%.texinfo info/fdl.texinfo
+ @mkdir -p obj
+ cd obj && yes X | texi2pdf --ps ../$<
+ mv obj/$@ $@
+
+
+.PHONY: install
+install: install-base install-info
+
+.PHONY: install-all
+install-all: install-base install-doc
+
+.PHONY: install-base
+install-base: install-command install-license
+
+.PHONY: install-command
+install-command: bin/Assemble.class
+ install -dm755 "$(DESTDIR)$(BINDIR)"
+ install -dm755 "$(DESTDIR)$(LIBEXECDIR)"
+ install -m644 bin/Assemble.class "$(DESTDIR)$(LIBEXECDIR)"/Assemble.class
+ install -m755 src/parse.py "$(DESTDIR)$(LIBEXECDIR)"/parse.py
+ install -m755 src/trim.py "$(DESTDIR)$(LIBEXECDIR)"/trim.py
+ install -m755 src/splashtool "$(DESTDIR)$(LIBEXECDIR)"/splashtool
+ ln -sf "$(LIBEXECDIR)"/splashtool "$(DESTDIR)$(BINDIR)"/splashtool
+
+.PHONY: install-license
+install-license:
+ install -dm755 -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
+ install -m644 -- COPYING LICENSE "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
+
+.PHONY: install-doc
+install-doc: install-info install-pdf install-ps install-dvi
+
+.PHONY: install-info
+install-info: splashtool.info
+ install -dm755 -- "$(DESTDIR)$(INFODIR)"
+ install -m644 -- $< "$(DESTDIR)$(INFODIR)/$(PKGNAME).info"
+
+.PHONY: install-pdf
+install-pdf: splashtool.pdf
+ install -dm755 -- "$(DESTDIR)$(DOCDIR)"
+ install -m644 -- $< "$(DESTDIR)$(DOCDIR)/$(PKGNAME).pdf"
+
+.PHONY: install-ps
+install-ps: splashtool.ps
+ install -dm755 -- "$(DESTDIR)$(DOCDIR)"
+ install -m644 -- $< "$(DESTDIR)$(DOCDIR)/$(PKGNAME).ps"
+
+.PHONY: install-dvi
+install-dvi: splashtool.dvi
+ install -dm755 -- "$(DESTDIR)$(DOCDIR)"
+ install -m644 -- $< "$(DESTDIR)$(DOCDIR)/$(PKGNAME).dvi"
-install: bin/Assemble.class splashtool.info.gz
- install -dm755 "$(DESTDIR)$(PREFIX)$(BIN)"
- install -dm755 "$(DESTDIR)$(PREFIX)$(LIBEXEC)"
- install -dm755 "$(DESTDIR)$(PREFIX)$(DATA)/info"
- install -dm755 '$(DESTDIR)$(LICENSES)/$(PKGNAME)'
- install -m644 bin/Assemble.class "$(DESTDIR)$(PREFIX)$(LIBEXEC)"/Assemble.class
- install -m755 src/parse.py "$(DESTDIR)$(PREFIX)$(LIBEXEC)"/parse.py
- install -m755 src/trim.py "$(DESTDIR)$(PREFIX)$(LIBEXEC)"/trim.py
- install -m755 src/splashtool "$(DESTDIR)$(PREFIX)$(LIBEXEC)"/splashtool
- ln -sf "$(PREFIX)$(LIBEXEC)"/splashtool "$(DESTDIR)$(PREFIX)$(BIN)"/splashtool
- install -m644 COPYING LICENSE '$(DESTDIR)$(LICENSES)/$(PKGNAME)'
- install -m644 splashtool.info.gz "$(DESTDIR)$(PREFIX)$(DATA)/info/$(PKGNAME).info.gz"
uninstall:
- rm -- "$(DESTDIR)$(PREFIX)$(BIN)"/splashtool
- rm -- "$(DESTDIR)$(PREFIX)$(LIBEXEC)"/Assemble.class
- rm -- "$(DESTDIR)$(PREFIX)$(LIBEXEC)"/parse.py
- rm -- "$(DESTDIR)$(PREFIX)$(LIBEXEC)"/trim.py
- rm -- "$(DESTDIR)$(PREFIX)$(LIBEXEC)"/splashtool
- -rmdir -- "$(DESTDIR)$(PREFIX)$(LIBEXEC)"
- rm -- '$(DESTDIR)$(LICENSES)/$(PKGNAME)/COPYING'
- rm -- '$(DESTDIR)$(LICENSES)/$(PKGNAME)/LICENSE'
- rmdir -- '$(DESTDIR)$(LICENSES)/$(PKGNAME)'
- rm -- '$(DESTDIR)$(PREFIX)$(DATA)/info/$(PKGNAME).info.gz'
+ -rm -- "$(DESTDIR)$(BINDIR)"/splashtool
+ -rm -- "$(DESTDIR)$(LIBEXECDIR)"/Assemble.class
+ -rm -- "$(DESTDIR)$(LIBEXECDIR)"/parse.py
+ -rm -- "$(DESTDIR)$(LIBEXECDIR)"/trim.py
+ -rm -- "$(DESTDIR)$(LIBEXECDIR)"/splashtool
+ -rmdir -- "$(DESTDIR)$(LIBEXECDIR)"
+ -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).ps"
+ -rm -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME).dvi"
clean:
- -rm -r bin {*,info/*}.{aux,cp,fn,info,ky,log,pdf,ps,dvi,pg,toc,tp,vr}
+ -rm -r obj bin *.{info,pdf,dvi,ps}