diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 69 |
1 files changed, 65 insertions, 4 deletions
@@ -51,10 +51,13 @@ STD = c99 # Build rules .PHONY: default -default: command +default: base info .PHONY: all -all: command +all: base doc + +.PHONY: base +base: command .PHONY: command command: bin/exec-as @@ -67,12 +70,46 @@ obj/%.o: src/%.c @mkdir -p obj $(CC) -std=$(STD) $(WARN) $(OPTIMISE) -c -o $@ $< $(CFLAGS) $(CPPFLAGS) +.PHONY: doc +doc: info pdf dvi ps + +.PHONY: info +info: bin/exec-as.info +bin/%.info: doc/info/%.texinfo + @mkdir -p bin + $(MAKEINFO) $< + mv $*.info $@ + +.PHONY: pdf +pdf: bin/exec-as.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/exec-as.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/exec-as.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 $@ + # Install rules .PHONY: install -install: install-base install-man +install: install-base install-info install-man .PHONY: install-all install-all: install-base install-doc @@ -99,7 +136,27 @@ install-license: install -m644 LICENSE -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)" .PHONY: install-doc -install-doc: install-man +install-doc: install-info install-pdf install-dvi install-ps install-man + +.PHONY: install-info +install-info: bin/exec-as.info + install -dm755 -- "$(DESTDIR)$(INFODIR)" + install -m644 $< -- "$(DESTDIR)$(INFODIR)/$(PKGNAME).info" + +.PHONY: install-pdf +install-pdf: bin/exec-as.pdf + install -dm755 -- "$(DESTDIR)$(DOCDIR)" + install -m644 $< -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME).pdf" + +.PHONY: install-dvi +install-dvi: bin/exec-as.dvi + install -dm755 -- "$(DESTDIR)$(DOCDIR)" + install -m644 $< -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME).dvi" + +.PHONY: install-ps +install-ps: bin/exec-as.ps + install -dm755 -- "$(DESTDIR)$(DOCDIR)" + install -m644 $< -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME).ps" .PHONY: install-man install-man: @@ -116,6 +173,10 @@ uninstall: -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" -rm -- "$(DESTDIR)$(MAN1DIR)/$(COMMAND).1" |