]> granicus.if.org Git - procps-ng/commitdiff
docs: more Makefile updates
authorCraig Small <csmall@dropbear.xyz>
Tue, 12 Nov 2019 10:15:33 +0000 (21:15 +1100)
committerCraig Small <csmall@dropbear.xyz>
Tue, 12 Nov 2019 10:15:33 +0000 (21:15 +1100)
The install target was using the wrong directory and would throw
some errors where a language couldn't translate man pages. This
one should be hopefully more robust.

man-po/Makefile.am

index 259efe0c4ca47a0864b55e80246328385eeae737..bc981f7b9102b2765342c3843a1fe7e534469aa4 100644 (file)
@@ -6,9 +6,13 @@
 #   make -C man-po po4a-dist
 # To update man page translations
 
-DIST_translated_MANS = $(shell find translated -name '*.[1-9]')
+translated_MANS = $(wildcard translated/*/*.[1-9])
+translated_MAN_sections=$(subst .,,$(sort $(suffix $(translated_MANS))))
+
+translated_langs = $(notdir $(wildcard translated/*))
 
-EXTRA_DIST = po4a.cfg $(DIST_translated_MANS)
+
+EXTRA_DIST = po4a.cfg $(translated_MANS)
 
 if USE_PO4A
 
@@ -16,16 +20,18 @@ po4a-dist:
        -@po4a -M utf-8 -k 0 po4a.cfg
 endif
 
-translated_langs = $(notdir $(wildcard translated/*))
 
 install-data-local:
        for l in $(translated_langs) ; do \
-           for sect in `ls translated/$$l` ; do \
-             $(MKDIR_P) $(DESTDIR)$(mandir)/$$l/$$sect ; \
-             for file in `ls translated/$$l/$$sect` ; do \
-                 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/$$l/$$sect ; \
-              done ; \
+           for sect in $(translated_MAN_sections) ; do \
+             manpages=`ls translated/$$l/*.$$sect 2>/dev/null` ; \
+             if [ -n "$$manpages" ] ; then \
+                 $(MKDIR_P) $(DESTDIR)$(mandir)/$$l/man$$sect ; \
+                 for file in `ls translated/$$l/*.$$sect` ; do \
+                     $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/$$l/man$$sect ; \
+                  done ; \
+             fi ; \
             done ; \
        done
 
-.PHONY = translated_langs get-trans po4a-dist
+.PHONY = translated_langs po4a-dist