는이 질문에 대한 쉬운 해결책은없는 것 같다이다; 다음은 나를 위해 일한다.
configure.ac
에서 help2man을 확인해야합니다. 크로스 컴파일 할 경우 help2man을 실행하면 안됩니다. 실행 파일이 실행됩니다. 따라서 다음 스 니펫이 포함되어 있습니다.
# Man pages
AS_IF([test "$cross_compiling" = "no"], [
AM_MISSING_PROG([HELP2MAN], [help2man])
], [
HELP2MAN=:
])
건물에는 2 단계 개념이 있습니다. 먼저 맨페이지가 실행 파일보다 새로운 지 확인합니다. 그렇다면 불필요한 맨 페이지 재 작성을 금지하기 위해 맨 페이지 자체가 변경되었을 때 마지막으로 변경된 임시 파일을 사용하여 소스를 검사합니다. 그래서, Makefile.am
에는 다음이 포함 발견하고이 솔루션을 제공하는 헨드릭 Oenings에
dist_man_MANS = foo.1
EXTRA_DIST += $(dist_man_MANS:.1=.x) common.x
MOSTLYCLEANFILES += $(dist_man_MANS:=-t)
MAINTAINERCLEANFILES += $(dist_man_MANS)
common_dep = $(top_srcdir)/common.x $(top_srcdir)/configure.ac $(top_srcdir)/.version
common_indirect_dep = $(top_srcdir)/common.x $(top_srcdir)/configure $(top_srcdir)/.version
foo.1 : $(common_indirect_dep) $(top_builddir)/foo$(EXEEXT)
foo.1-t : $(common_dep) $(top_srcdir)/main-helpversion.c
SUFFIXES += .x .1 .1-t
.x.1:
test -f [email protected] || if test -f $(top_srcdir)/`echo $@ | $(SED) -e 's,.*/,,'`; then \
touch -r $(top_srcdir)/`echo [email protected] | $(SED) -e 's,.*/,,'` [email protected]; \
else \
touch -d @0 [email protected]; \
fi
touch -r [email protected] [email protected]
$(MAKE) $(AM_MAKEFLAGS) [email protected]
if test -s [email protected]; then \
mv -f [email protected] [email protected]; \
else \
rm -f [email protected]; \
if test -s [email protected]; then touch [email protected]; else rm -f [email protected]; fi; \
fi
.x.1-t:
$(HELP2MAN) -o [email protected] -I $< -I $(top_srcdir)/common.x -s 1 foo$(EXEEXT)
감사합니다. 당신은 작동 예제 in his git repoitory을 찾을 수 있습니다. 필요하지 않은 경우에도 프로그램을 빌드하는 것처럼 몇 가지 단점이 있지만 일반적으로 맨 페이지를 빌드 할 때 프로그램이 빌드됩니다.
아이디어가 있습니까? – xanoetux