From 047c9df21da7a3992e0350c67437188046a93956 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Mon, 4 Apr 2016 01:33:26 +0000 Subject: Makefile.common: Rework gendep mechanism Fix the FIXME to also automatically print gettext dependencies. Do this by moving the detection code from inline shell to a separate gendep.pl perl script which allows for easier pattern matching. Also update the output of gendep in Makefile.common. Apparently it was quite old. CVS version numbers Makefile.common: 1.109 -> 1.110 gendep.pl: INITIAL -> 1.1 --- gendep.pl | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 gendep.pl (limited to 'gendep.pl') diff --git a/gendep.pl b/gendep.pl new file mode 100755 index 00000000000..83c4f695208 --- /dev/null +++ b/gendep.pl @@ -0,0 +1,26 @@ +#!/usr/bin/perl +use strict; +use warnings; + +my $file = $ARGV[0]; + +open my $fh, '<', $file or die "couldn't open file $file: $!\n"; +my @templates; +my @locales; +while( my $line = <$fh> ){ + if( $line =~ /^#use wml::debian::(\S+)/ ){ + next if $1 eq 'openrecode'; + push @templates, $1; + }elsif( $line =~ /bind-gettext-domain\s+domain="(\S+)"/ ){ + push @locales, $1; + } +} +close $fh or warn "couldn't close file $file: $!\n"; + +if( @templates || @locales ){ + print "X$file: "; + print join(' ', map{ s|::|/|g; '$(TEMPLDIR)/'.$_.'.wml' } @templates) if @templates; + print ' ' if @templates && @locales; + print join(' ', map{ '$(callXlocale,'.$_.')' } @locales) if @locales; + print "\n"; +} -- cgit v1.2.3