File: create-makefile

package info (click to toggle)
dvdisaster 0.79.5-10
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 42,960 kB
  • sloc: ansic: 33,411; sh: 4,898; makefile: 138
file content (60 lines) | stat: -rw-r--r-- 1,304 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# dvdisaster: Create the locale Makefile.
# This is called from the toplevel ./configure script.

cat > Makefile <<EOF
# This makefile template was automatically generated by
# the create-makefile script. Do not hand-edit!

EOF

for i in ../*.c; do
  cfiles="$cfiles $i"
  nopath=`echo $i | sed -e 's/..\///'`
  cfiles2="$cfiles2 $nopath"
done

for i in *.po; do
  prefix=`echo $i | sed -e 's/.po//'`
  if ! test -e $prefix; then mkdir $prefix; fi
  if ! test -e $prefix/LC_MESSAGES; then mkdir $prefix/LC_MESSAGES; fi
  localefiles="$localefiles $prefix/LC_MESSAGES/dvdisaster.mo"
  prefixes="$prefixes $prefix"
done

cat >> Makefile <<EOF
LOCALEFILES = $localefiles
CFILES      = $cfiles
CFILES_NP   = $cfiles2

locale: \$(LOCALEFILES)

# Create the locale files. 

messages.pot: \$(CFILES)
	@cd ..; xgettext --no-wrap -cTRANSLATORS: -o locale/messages.pot -k_ -k_utf \$(CFILES_NP)

clean:
	rm -f messages.pot

EOF

for i in $prefixes; do
cat >> Makefile <<EOF
$i.po: messages.pot
	@echo "Updating $i.po"
	@msgmerge -q -U --no-wrap --no-fuzzy-matching $i.po messages.pot

$i/LC_MESSAGES/dvdisaster.mo: $i.po
	@echo "Updating $i.mo"
	@msgfmt -c -o $i/LC_MESSAGES/dvdisaster.mo $i.po


EOF
done

cat >> Makefile <<EOF
.PHONY : check-untranslated

check-untranslated:
	@msgattrib --untranslated de.po
EOF