~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to admin/Makefile.common

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
SHELL=/bin/sh
 
3
 
 
4
cvs:
 
5
        @if grep '$$(top_srcdir)/acinclude.m4:' Makefile.am >/dev/null; then \
 
6
          echo "*** Creating acinclude.m4" ;\
 
7
          rm -f acinclude.m4 configure.files ;\
 
8
          $(MAKE) -f Makefile.am top_srcdir=. acinclude.m4 ;\
 
9
        fi
 
10
        @echo "!!! If you get recursion errors from autoconf, it is advisable to set the"
 
11
        @echo "    environment variable M4 to something including \"--nesting-limit=500\""
 
12
        @if test -r configure.in.in; then \
 
13
          rm -f subdirs configure.in ;\
 
14
          echo "*** Creating list of subdirectories" ;\
 
15
          $(MAKE) -f Makefile.am top_srcdir=. subdirs ;\
 
16
          echo "*** Creating configure.in" ;\
 
17
          $(MAKE) -f Makefile.am top_srcdir=. configure.in ;\
 
18
        fi
 
19
        @echo "*** Creating aclocal.m4"
 
20
        @aclocal
 
21
        @echo "*** Creating configure"
 
22
        @autoconf
 
23
        @if test -r configure.in.in ; then \
 
24
          perl -pi -e 'print "if test \"x\$$with_fast_perl\" = \"xyes\" ;\
 
25
          then\n  perl -i.bak \$$ac_aux_dir/conf.change.pl \$$CONFIG_STATUS\
 
26
          || mv \$$CONFIG_STATUS.bak \$$CONFIG_STATUS;\
 
27
          \n  rm -f \$$CONFIG_STATUS.bak;\nfi\
 
28
          \n" if /^\s*chmod\s+.*\+x\s+.*CONFIG_STATUS/;' configure ;\
 
29
        fi
 
30
        @if grep '} \$$ac_kw foo' configure >/dev/null 2>&1; then perl -p -i -e "s/ac_kw foo/ac_kw int foo/" configure; fi
 
31
#David's hack for autoconf bug when $INSTALL is set
 
32
        @perl -pi -e 'if (/\[\/\$$\]\*. INSTALL=/) { print $$_ ; $$_ = "\"\") ;;\n"; }' configure
 
33
        @if egrep "^AM_CONFIG_HEADER" configure.in >/dev/null 2>&1; then \
 
34
          echo "*** Creating config.h template" ;\
 
35
                autoheader ;\
 
36
        fi
 
37
        @echo "*** Creating Makefile templates"
 
38
        @automake
 
39
        @echo "*** Postprocessing Makefile templates"
 
40
        @perl admin/am_edit
 
41
        @if egrep "^cvs-local:" Makefile.am >/dev/null; then \
 
42
          $(MAKE) -f Makefile.am cvs-local ;\
 
43
        fi
 
44
        @echo "*** Creating date/time stamp"
 
45
        @touch stamp-h.in
 
46
        @echo "*** Finished"
 
47
        @echo "    Don't forget to run ./configure"
 
48
        @echo "    If you haven't done so in a while, run ./configure --help"
 
49
 
 
50
dist:   
 
51
        @if grep -e '$$(top_srcdir)/acinclude.m4:' Makefile.am >/dev/null; then \
 
52
          $(MAKE) -f Makefile.am top_srcdir=. acinclude.m4 ;\
 
53
        fi
 
54
        @if test -r configure.in.in; then \
 
55
          $(MAKE) -f Makefile.am top_srcdir=. subdirs configure.in; \
 
56
        fi ;\
 
57
        aclocal; \
 
58
        autoheader; \
 
59
        automake --foreign --include-deps; \
 
60
        perl admin/am_edit; \
 
61
        autoconf; \
 
62
        if test -r configure.in.in ; then \
 
63
          perl -pi -e 'print "if test \"x\$$with_fast_perl\" = \"xyes\" ;\
 
64
          then\n  perl -i.bak \$$ac_aux_dir/conf.change.pl \$$CONFIG_STATUS\
 
65
          || mv \$$CONFIG_STATUS.bak \$$CONFIG_STATUS;\
 
66
          \n  rm -f \$$CONFIG_STATUS.bak;\nfi\
 
67
          \n" if /^\s*chmod\s+.*\+x\s+.*CONFIG_STATUS/;' configure ;\
 
68
        fi ;\
 
69
        touch stamp-h.in; \
 
70
        if grep -e "^cvs-local:" Makefile.am >/dev/null; then \
 
71
          $(MAKE) -f Makefile.am cvs-local ;\
 
72
        fi ;\
 
73
        if grep "ac_kw foo" configure >/dev/null 2>&1; then perl -p -i -e "s/ac_kw foo/ac_kw int foo/" configure; fi ;\
 
74
        if test -d po; then \
 
75
         LIST=`find ./po -name "*.po"`; \
 
76
         for i in $$LIST; do \
 
77
          file2=`echo $$i | sed -e "s#\.po#\.gmo#"`; \
 
78
          msgfmt -o $$file2 $$i || touch $$file2; \
 
79
         done ;\
 
80
        fi
 
81
        @if grep -e "^cvs-dist-local:" Makefile.am >/dev/null; then \
 
82
          $(MAKE) -f Makefile.am cvs-dist-local ;\
 
83
        fi
 
84
 
 
85
cvs-clean:
 
86
        @if test ! -d CVS; then \
 
87
          echo "You don't have a toplevel CVS directory."; \
 
88
          echo "You most certainly didn't use cvs to get these sources."; \
 
89
          echo "But this function depends on cvs's information."; \
 
90
          exit 1 ;\
 
91
        fi;\
 
92
        pwd=`pwd` ;\
 
93
        dirs=`find . -type d | grep -v CVS | sed -e "s#^./##"` ;\
 
94
        for i in $$dirs; do \
 
95
          if test ! -d "$$pwd/$$i/CVS"; then \
 
96
            echo "D $$i" ;\
 
97
            rm -rf "$$pwd/$$i"; \
 
98
            continue; \
 
99
          fi ;\
 
100
          cd $$pwd/$$i ;\
 
101
          for f in * .*; do \
 
102
            if test ! -d "$$f"; then \
 
103
              if grep "^/$$f/" CVS/Entries > /dev/null; then \
 
104
                a="b"; \
 
105
              else \
 
106
                echo "F $$i/$$f"; \
 
107
                rm -f "$$pwd/$$i/$$f"; \
 
108
              fi; \
 
109
            fi ; \
 
110
          done; \
 
111
        done
 
112
 
 
113
 
 
114
# The Makefiles have to be sorted for slashes, since configure creates
 
115
# only one directory per Makefile not the whole hierarchy
 
116
configure.in: configure.files $(shell test -f configure.files && cat configure.files) subdirs
 
117
        @rm -f configure.in configure.in.new ;\
 
118
        cat `cat configure.files | egrep -v "^configure.in.bot"` >> configure.in.new ;\
 
119
        echo "KDE_CREATE_SUBDIRSLIST" >> configure.in.new ;\
 
120
        echo "AC_OUTPUT( \\" >> configure.in.new ;\
 
121
        mfs=`find . -type d -print | fgrep -v "/." | sed -e "s#\./##" -e "/^debian/d" | sort`; \
 
122
        for i in $$mfs; do \
 
123
          topleveldir=`echo $$i| sed -e "s#/.*##"`; \
 
124
          if test -f $$topleveldir/configure.in; then \
 
125
                continue; \
 
126
          fi ;\
 
127
          if test ! -f $$i/Makefile.am; then \
 
128
                continue; \
 
129
          fi ;\
 
130
          if test -s inst-apps; then \
 
131
            if test -z "`grep \"^$$topleveldir\" inst-apps`"; then \
 
132
                continue; \
 
133
            fi ;\
 
134
          fi ;\
 
135
          echo "$$i/Makefile \\" >> configure.in.new ;\
 
136
        done ;\
 
137
        egrep '^dnl AC_OUTPUT\(.*\)' `cat configure.files` | sed -e "s#^.*dnl AC_OUTPUT(\(.*\))#\1 \\\\#" >> configure.in.new ;\
 
138
        echo ")" >> configure.in.new
 
139
        @modulename= ;\
 
140
        if test -f configure.in.in; then \
 
141
           if head -2 configure.in.in | egrep "^#MIN_CONFIG$$" > /dev/null; then \
 
142
              line=`egrep "^AM_INIT_AUTOMAKE\(" configure.in.in` ;\
 
143
              if test -n "$$line"; then \
 
144
                  modulename=`echo $$line | sed -e "s#AM_INIT_AUTOMAKE(\([^,]*\),.*#\1#"` ;\
 
145
                  VERSION=`echo $$line | sed -e "s#AM_INIT_AUTOMAKE([^,]*, *\([^)]*\)).*#\1#"` ;\
 
146
               fi ;\
 
147
              sed -e "s#AM_INIT_AUTOMAKE([^@].*#dnl PACKAGE set before#" configure.in.new > configure.in \
 
148
                  && mv configure.in configure.in.new ;\
 
149
           fi ;\
 
150
        fi ;\
 
151
        if test -z "$$modulename" || test "$$modulename" = "@MODULENAME@"; then \
 
152
           modulename=`pwd`; modulename=`basename $$modulename`; \
 
153
        fi ;\
 
154
        if test -z "$$VERSION" || test "$$VERSION" = "@VERSION@"; then \
 
155
             VERSION="\"2.2.2\"";  \
 
156
        fi ;\
 
157
        sed -e "s#@MODULENAME@#$$modulename#" configure.in.new | \
 
158
                sed -e "s#@VERSION@#$$VERSION#" > configure.in
 
159
        @if test -f configure.in.bot ; then cat configure.in.bot >> configure.in ; fi
 
160
        @rm -f configure.in.new
 
161
 
 
162
configure.files: subdirs
 
163
        @admindir=NO ;\
 
164
        for i in . .. ../.. ../../..; do \
 
165
          if test -x $$i/admin; then admindir=$$i/admin; break; fi; \
 
166
        done ;\
 
167
        rm -rf configure.files ;\
 
168
        if test -f configure.in.in && head -2 configure.in.in | egrep "^#MIN_CONFIG$$" > /dev/null; then \
 
169
                echo $$admindir/configure.in.min >> configure.files  ;\
 
170
        fi
 
171
        @test -f configure.in.in && echo configure.in.in >> configure.files
 
172
        @list=`find . -name "configure.in.in" | sort`; \
 
173
        for i in $$list; do if test -f $$i && test ! `dirname $$i` = "." ; then \
 
174
          echo $$i >> configure.files ;\
 
175
        fi; done
 
176
        @if test -f configure.in.mid ; then echo configure.in.mid >> configure.files ; fi
 
177
        @if test -f configure.in.bot ; then echo configure.in.bot >> configure.files ; fi
 
178
 
 
179
subdirs:
 
180
        @files=`ls -1 | sort`; \
 
181
        dirs= ;\
 
182
        lib_dirs= ;\
 
183
        first_dirs= ;\
 
184
        last_dirs= ;\
 
185
        compilefirst=`grep '^COMPILE_FIRST[ ]*=' Makefile.am | \
 
186
                sed -e 's#^COMPILE_FIRST[ ]*=[ ]*#|#' | sed -e 's#$$#|#' | sed -e 's# #|#g'`;\
 
187
        compilelast=`grep '^COMPILE_LAST[ ]*=' Makefile.am | \
 
188
                sed -e 's#^COMPILE_LAST[ ]*=[ ]*#|#' | sed -e 's#$$#|#' | sed -e 's# #|#g'`;\
 
189
        for i in $$files; do if test -d $$i; then \
 
190
            if test -f $$i/Makefile.am; then \
 
191
                if echo $$compilefirst | grep "|$$i|" >/dev/null; then \
 
192
                        first_dirs="$$first_dirs $$i" ;\
 
193
                elif echo $$compilelast | grep "|$$i|" >/dev/null; then \
 
194
                        last_dirs="$$last_dirs $$i" ; \
 
195
                else dirs="$$dirs $$i" ;\
 
196
                fi ;\
 
197
             fi ;\
 
198
           fi; \
 
199
        done ;\
 
200
        rm -f SUBDIRS ;\
 
201
        for i in $$dirs; do \
 
202
        echo $$i >> ./SUBDIRS; \
 
203
        done
 
204
        @if test -r subdirs && diff subdirs SUBDIRS > /dev/null; then \
 
205
          rm -f SUBDIRS; \
 
206
        fi
 
207
        @test -r SUBDIRS && mv SUBDIRS subdirs || true
 
208
 
 
209
package-merge:
 
210
        @catalogs='$(POFILES)'; \
 
211
        for cat in $$catalogs; do \
 
212
        echo $$cat $$name; \
 
213
        msgmerge -o $$cat.new $$cat $(PACKAGE).pot ; \
 
214
        if test -s $$cat.new; then \
 
215
          grep -v "\"POT-Creation" $$cat.new > $$cat.new.2 ; \
 
216
          grep -v "\"POT-Creation" $$cat >> $$cat.new.1; \
 
217
          if diff $$cat.new.1 $$cat.new.2; then \
 
218
                rm $$cat.new;  \
 
219
          else  \
 
220
                mv $$cat.new $$cat ; \
 
221
        fi; \
 
222
        rm -f $$cat.new.1 $$cat.new.2 ;\
 
223
        fi ;\
 
224
        done
 
225
 
 
226
 
 
227
package-messages:
 
228
        @rm -rf po.backup ;\
 
229
        mkdir po.backup ;\
 
230
        for i in `ls -1 po/*.pot 2>/dev/null | sed -e "s#po/##"`; do \
 
231
          egrep -v '^#([^:]|$)' po/$$i | egrep '^.*[^ ]+.*$$' | grep -v "\"POT-Creation" > po.backup/$$i ; \
 
232
          cp po/$$i po.backup/backup_$$i ;  \
 
233
          touch -r po/$$i po.backup/backup_$$i ;\
 
234
          rm po/$$i ;\
 
235
        done
 
236
        @podir=$${podir:-$$PWD/po} ;\
 
237
        files=`find . -name Makefile.am | xargs egrep -l '^messages:' `; \
 
238
        dirs=`for i in $$files; do echo \`dirname $$i\`; done`; \
 
239
        tmpname="$$PWD/messages.log" ;\
 
240
        if test -z "$$EXTRACTRC"; then EXTRACTRC=extractrc ; fi ;\
 
241
        if test -z "$$PREPARETIPS"; then PREPARETIPS=preparetips ; fi ;\
 
242
        export EXTRACTRC PREPARETIPS ;\
 
243
        for subdir in $$dirs; do \
 
244
          test -z "$$VERBOSE" || echo "Making messages in $$subdir"; \
 
245
          (cd $$subdir ;\
 
246
           if test -n "`grep -e '^messages:.*rc.cpp' Makefile.am`"; then \
 
247
                $$EXTRACTRC *.rc *.ui > rc.cpp ;\
 
248
           else \
 
249
                candidates=`ls -1 *.rc *.ui 2>/dev/null` ;\
 
250
                if test -n "$$candidates"; then \
 
251
                    echo "$$subdir has *.rc or *.ui files, but not correct messages line" ;\
 
252
                fi ;\
 
253
           fi ;\
 
254
           if test -n "`grep -r KAboutData *.c* *.C* 2>/dev/null`"; then \
 
255
                echo -e 'i18n("_: NAME OF TRANSLATORS\\n"\n"Your names")\ni18n("_: EMAIL OF TRANSLATORS\\n"\n"Your emails")' > _translatorinfo.cpp ;\
 
256
           else echo " " > _translatorinfo.cpp ;\
 
257
           fi; \
 
258
           perl -e '$$mes=0; while (<STDIN>) { if (/^messages:/) { $$mes=1; print $$_; next; } if ($$mes) { if (/$$\\(XGETTEXT\)/ && / -o/) { s/ -o \$$\(podir\)/ _translatorinfo.cpp -o \$$\(podir\)/ } print $$_; } else { print $$_; } }' < Makefile.am > _transMakefile ;\
 
259
           $(MAKE) -s -f _transMakefile podir=$$podir EXTRACTRC="$$EXTRACTRC" PREPARETIPS="$$PREPARETIPS" \
 
260
           XGETTEXT="$${XGETTEXT:-xgettext} -C -ki18n \
 
261
           -kI18N_NOOP -ktranslate -kaliasLocale \
 
262
           -x $${includedir:-$$KDEDIR/include}/kde.pot" \
 
263
           messages ) >$$tmpname 2>&1 ;\
 
264
           test -s $$tmpname && (echo $$subdir ; cat $$tmpname) ;\
 
265
           test ! -f $$subdir/rc.cpp || rm -f $$subdir/rc.cpp ;\
 
266
           rm -f $$subdir/_translatorinfo.cpp ;\
 
267
           rm -f $$subdir/_transMakefile ;\
 
268
        done
 
269
        rm -f $$tmpname
 
270
        @for i in `ls -1 po.backup/*.pot 2>/dev/null | sed -e "s#po.backup/##" | egrep -v '^backup_'`; do \
 
271
          if test ! -f po/$$i; then echo "disappeared: $$i"; fi ;\
 
272
        done
 
273
        @for  i in `ls -1 po/*.pot 2>/dev/null | sed -e "s#po/##"`; do \
 
274
           egrep -v '^#([^:]|$)' po/$$i | egrep '^.*[^ ]+.*$$' | grep -v "\"POT-Creation" > temp.pot ;\
 
275
          if test -f po.backup/$$i && test -n "`diff temp.pot po.backup/$$i`"; then \
 
276
                echo "will update $$i"; \
 
277
                msgmerge -q po.backup/backup_$$i po/$$i > temp.pot ;\
 
278
                mv temp.pot po/$$i; \
 
279
           else \
 
280
            if test -f po.backup/backup_$$i; then \
 
281
              test -z "$$VERBOSE" || echo "I'm restoring $$i" ;\
 
282
              mv po.backup/backup_$$i po/$$i; \
 
283
              rm po.backup/$$i; \
 
284
            else \
 
285
              echo "will add $$i" ;\
 
286
            fi ;\
 
287
        fi ;\
 
288
        done
 
289
        @rm -f temp.pot
 
290
        @rm -rf po.backup
 
291
 
 
292
test:
 
293
        perl -e '$$mes=0; while (<STDIN>) { if (/^messages:/) { $$mes=1; print $$_; next; } if ($$mes) { if (! /^\t/) { exit(0); } if (/$$\\(XGETTEXT\)/ && / -o/) { s/ -o/ _translatorinfo.cpp -o/ } print $$_;  } }' < Makefile.am
 
294
 
 
295
.SILENT: