diff options
-rw-r--r-- | Makefile | 53 |
1 files changed, 50 insertions, 3 deletions
@@ -10,12 +10,57 @@ PREFIX=/usr +PROGRAM=adjbacklight +BOOK=$(PROGRAM) +BOOKDIR=./ + # compile the package -all: - javac -cp . Adjbacklight.java +.PHONY: all info +all: java + + +java: Adjbacklight.class + +%.class: %.java + javac -cp . "$<" + +info: $(BOOK).info.gz +%.info: $(BOOKDIR)%.texinfo + $(MAKEINFO) "$<" +%.info.gz: %.info + gzip -9c < "$<" > "$@" + + +pdf: $(BOOK).pdf +%.pdf: $(BOOKDIR)%.texinfo + texi2pdf "$<" + +pdf.gz: $(BOOK).pdf.gz +%.pdf.gz: %.pdf + gzip -9c < "$<" > "$@" + +pdf.xz: $(BOOK).pdf.xz +%.pdf.xz: %.pdf + xz -e9 < "$<" > "$@" + + +dvi: $(BOOK).dvi +%.dvi: $(BOOKDIR)%.texinfo + $(TEXI2DVI) "$<" + +dvi.gz: $(BOOK).dvi.gz +%.dvi.gz: %.dvi + gzip -9c < "$<" > "$@" + +dvi.xz: $(BOOK).dvi.xz +%.dvi.xz: %.dvi + xz -e9 < "$<" > "$@" + + # install to system +.PHONY: install install: mkdir -p $(DESTDIR)$(PREFIX)/bin mkdir -p $(DESTDIR)$(PREFIX)/share/licenses @@ -25,12 +70,14 @@ install: install -m 644 LICENSE $(DESTDIR)$(PREFIX)/share/licenses/adjbacklight # remove files created by `install` +.PHONY: uninstall uninstall: unlink $(DESTDIR)$(PREFIX)/bin/Adjbacklight.class unlink $(DESTDIR)$(PREFIX)/bin/adjbacklight rm -r $(DESTDIR)$(PREFIX)/share/licenses/adjbacklight # remove files created by `all` +.PHONY: clean clean: - rm Adjbacklight.class + rm -r *.{class,t2d,aux,cp,cps,fn,ky,log,pg,pgs,toc,tp,vr,vrs,op,ops,bak,info,pdf,ps,dvi,gz} || exit 0 |