diff options
| author | Mark Wielaard <mark@klomp.org> | 2021-05-05 23:33:14 +0200 |
|---|---|---|
| committer | Mark Wielaard <mark@klomp.org> | 2021-05-05 23:33:19 +0200 |
| commit | 4bb332c7a8e53f9e2ee7aefb5a33d19aeed482cf (patch) | |
| tree | 51d5314d6d770fb1dbad892abc0a22900321bf2a | |
| parent | Makefile.am: Add scripts/find-debuginfo.sh to EXTRA_DIST (diff) | |
Makefile.am: Don't try to recursively make binaries to run help2man
We try to avoid having to run help2man unnecessary for a build from a source distribution (which include the generated manpages). We did this by not depending on the actual executable, but recursively calling make to generate it when necessary. This causes trouble with parallel makes because the two make processes don't know which objects have, have not or are being build. Fix this by depending on the executable but only running help2man if one of the sources has changed, not when the executable has been regenerated. Signed-off-by: Mark Wielaard <mark@klomp.org>
| -rw-r--r-- | Makefile.am | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/Makefile.am b/Makefile.am index ef972e8..584e532 100644 --- a/Makefile.am +++ b/Makefile.am | |||
| @@ -41,23 +41,30 @@ sepdebugcrcfix_LDADD = @LIBELF_LIBS@ | |||
| 41 | # Manual pages are generated for dist | 41 | # Manual pages are generated for dist |
| 42 | dist_man_MANS = debugedit.1 sepdebugcrcfix.1 find-debuginfo.sh.1 | 42 | dist_man_MANS = debugedit.1 sepdebugcrcfix.1 find-debuginfo.sh.1 |
| 43 | 43 | ||
| 44 | # Common dependency for man pages. Man pages are only regenerated when | 44 | # The 'case' ensures the man pages are only generated if the corresponding |
| 45 | # their main source is newer, or configure.ac (version) is updated. | 45 | # source script (the first prerequisite) or configure.ac (for the version) |
| 46 | TOP_CONFIGURE_AC = $(top_srcdir)/configure.ac | 46 | # has been changed. The executable prerequisite is solely meant to force |
| 47 | # these docs to be made only after the executable has been compiled. | ||
| 48 | # This makes sure help2man is not normally necessary (since the generated | ||
| 49 | # man pages are distributed). | ||
| 50 | debugedit.1: tools/debugedit.c configure.ac debugedit$(EXEEXT) | ||
| 51 | @case '$?' in \ | ||
| 52 | *$<* | *configure.ac* ) $(HELP2MAN) -N --output=$@ \ | ||
| 53 | --name='debug source path manipulation tool' \ | ||
| 54 | ./debugedit$(EXEEXT) ;; \ | ||
| 55 | * ) : ;; \ | ||
| 56 | esac | ||
| 47 | 57 | ||
| 48 | debugedit.1: tools/debugedit.c $(TOP_CONFIGURE_AC) | 58 | sepdebugcrcfix.1: tools/sepdebugcrcfix.c configure.ac sepdebugcrcfix$(EXEEXT) |
| 49 | $(MAKE) $(AM_MAKEFLAGS) debugedit$(EXEEXT) | 59 | @case '$?' in \ |
| 50 | $(HELP2MAN) -N --output=$@ \ | 60 | *$<* | *configure.ac* ) $(HELP2MAN) -N --output=$@ \ |
| 51 | --name='debug source path manipulation tool' \ | 61 | --name='fixes CRC for separate .debug files' \ |
| 52 | ./debugedit$(EXEEXT) | 62 | ./sepdebugcrcfix$(EXEEXT) ;;\ |
| 53 | 63 | * ) : ;; \ | |
| 54 | sepdebugcrcfix.1: tools/sepdebugcrcfix.c $(TOP_CONFIGURE_AC) | 64 | esac |
| 55 | $(MAKE) $(AM_MAKEFLAGS) sepdebugcrcfix$(EXEEXT) | ||
| 56 | $(HELP2MAN) -N --output=$@ \ | ||
| 57 | --name='fixes CRC for separate .debug files' \ | ||
| 58 | ./sepdebugcrcfix$(EXEEXT) | ||
| 59 | 65 | ||
| 60 | find-debuginfo.sh.1: $(top_srcdir)/scripts/find-debuginfo.sh $(TOP_CONFIGURE_AC) | 66 | # Since the script isn't generated this doesn't need any special casing. |
| 67 | find-debuginfo.sh.1: $(top_srcdir)/scripts/find-debuginfo.sh | ||
| 61 | $(HELP2MAN) -N --output=$@ \ | 68 | $(HELP2MAN) -N --output=$@ \ |
| 62 | --name='finds debuginfo and processes it' \ | 69 | --name='finds debuginfo and processes it' \ |
| 63 | $(top_srcdir)/scripts/find-debuginfo.sh | 70 | $(top_srcdir)/scripts/find-debuginfo.sh |
