Skip to content

Commit

Permalink
Fix doc/Makefile dependency for install target
Browse files Browse the repository at this point in the history
This fixes GitHub issue #102
by making man document files require mandirs

For explicit rules, multiple rules for one target
results a merge of prerequisites [1]:

    example : preq-1
    example : | preq-3
    example : preq-2
        recipes

    <==> (equals)

    example : preq-1 preq-2 | preq-3
        recipes

For implicit rules, that is not:

    %.o : %.h
    %.o : %.c
        recipes

    <==>

    %.o : %.c
        recipes

    "%.o : %.h" w/o recipes means a Cancel Rule in implicit rule [2]
    which removes the specified implicit rule

[1]: https://www.gnu.org/software/make/manual/make.html#Multiple-Rules
[2]: https://www.gnu.org/software/make/manual/make.html#Canceling-Rules
  • Loading branch information
Xiami2012 authored and superm1 committed Apr 12, 2018
1 parent cfcb14f commit 4869af0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions docs/Makefile
Expand Up @@ -38,12 +38,10 @@ install : | mandirs
install : | $(foreach x, $(MAN1TARGETS), $(DESTDIR)$(mandir)/man1/$(x))
install : | $(foreach x, $(MAN3TARGETS), $(DESTDIR)$(mandir)/man3/$(x))

$(DESTDIR)$(mandir)/man1/%.1 : | mandirs
$(DESTDIR)$(mandir)/man1/%.1 : %.1
$(DESTDIR)$(mandir)/man1/%.1 : %.1 | mandirs
$(INSTALL) -m 644 $< $@

$(DESTDIR)$(mandir)/man3/%.3 : | mandirs
$(DESTDIR)$(mandir)/man3/%.3 : %.3
$(DESTDIR)$(mandir)/man3/%.3 : %.3 | mandirs
$(INSTALL) -m 644 $< $@

.PHONY: all clean test install mandirs

0 comments on commit 4869af0

Please sign in to comment.