diff --git a/Makefile.am b/Makefile.am index 0477d4e0a..e6b11c76d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -43,3 +43,10 @@ EXTRA_DIST= \ # get rid of SVN stuff in the tarball dist-hook: rm -rf `find $(distdir) -type d -name .svn` + +# HACK Don't give make errors when switching between trunk and branches. +# Works by finding the .deps/*.Po files which refer to source files that don't exist, and replacing them with a single dependency on the correct source file. +.PHONY: fixbrokendeps +fixbrokendeps: + $(srcdir)/fixbrokendependencies +all: fixbrokendeps diff --git a/fixbrokendependencies b/fixbrokendependencies new file mode 100755 index 000000000..901d2ce99 --- /dev/null +++ b/fixbrokendependencies @@ -0,0 +1,39 @@ +#!/bin/bash + +# HACK Don't give make errors when switching between trunk and branches. +# Works by finding the .deps/*.Po files which refer to source files that don't exist, and replacing them with a single dependency on the correct source file. +# Now with PD-ksh support. + +if ! rootdir="`git rev-parse --show-cdup 2> /dev/null`" +then + echo "Not in a git repository." + exit 0 +fi + +for path in src/ lib/*/ lib/*/*/ +do + srcpath="${rootdir}${path}" + deppath="${path}.deps/" + if [ -d "${srcpath}" -a -d "${deppath}" ] + then + for ext in c cpp + do + # Iterate over all files that might have broken dependencies. + for fname in `cd ${srcpath} ; echo *.${ext}` + do + fpref="`echo "${fname}" | sed "s/\.${ext}//"`" + srcfile="${srcpath}${fname}" + depfile="${deppath}${fpref}.Po" + + # Check if the dependency file ${depfile} exists and is broken. (The ${srcfile} check prevents looking for files literally called "*.cpp".) + if [ -f "${srcfile}" -a -f "${depfile}" ] && ! grep -q "\b${fname}\b" "${depfile}" 2> /dev/null + then + relpath="`echo "${path}" | sed "s/[^./]*\//..\//g"`" + echo "${fpref}.o: ${relpath}${srcfile}" | tee "${depfile}" + fi + done + done + fi +done + +exit 0 diff --git a/lib/betawidget/src/Makefile.am b/lib/betawidget/src/Makefile.am index a990e1d66..de044aac3 100644 --- a/lib/betawidget/src/Makefile.am +++ b/lib/betawidget/src/Makefile.am @@ -74,10 +74,3 @@ noinst_HEADERS += \ ../../framework/types.h \ ../../framework/utf.h \ ../../ivis_opengl/GLee.h - -# HACK Don't give make errors when switching between trunk and branches. -# Works by finding the .deps/*.Po files which refer to source files that don't exist, and replacing them with a single dependency on the correct source file. -# Now with PD-ksh support. -fixbrokendependencies: - mkdir -p ".deps" ; for ext in c cpp ; do for a in `cd $(srcdir) ; echo *.$$ext` ; do fpref="`echo "$$a" | sed "s/\.$$ext//"`" ; pofile=".deps/$$fpref.Po" ; srcfile="$(srcdir)/$$a" ; if [ -e "$$srcfile" ] && ! grep -q "\b$$a\b" "$$pofile" 2> /dev/null ; then echo "$$fpref.o: $$srcfile" | tee "$$pofile" ; fi ; done ; done -all: fixbrokendependencies diff --git a/lib/betawidget/tools/Makefile.am b/lib/betawidget/tools/Makefile.am index 7103a8b5d..d740b7945 100644 --- a/lib/betawidget/tools/Makefile.am +++ b/lib/betawidget/tools/Makefile.am @@ -7,10 +7,3 @@ sdl_testapp_SOURCES = \ sdl_testapp_CPPFLAGS = $(LUA_CFLAGS) $(SDL_CFLAGS) $(CAIRO_CFLAGS) -DLIB_COMPILE=1 sdl_testapp_LDADD = $(OPENGL_LIBS) $(CAIRO_LIBS) $(SDL_LIBS) $(top_builddir)/src/libbetawidget.la $(LUA_LIBS) - -# HACK Don't give make errors when switching between trunk and branches. -# Works by finding the .deps/*.Po files which refer to source files that don't exist, and replacing them with a single dependency on the correct source file. -# Now with PD-ksh support. -fixbrokendependencies: - mkdir -p ".deps" ; for ext in c cpp ; do for a in `cd $(srcdir) ; echo *.$$ext` ; do fpref="`echo "$$a" | sed "s/\.$$ext//"`" ; pofile=".deps/$$fpref.Po" ; srcfile="$(srcdir)/$$a" ; if [ -e "$$srcfile" ] && ! grep -q "\b$$a\b" "$$pofile" 2> /dev/null ; then echo "$$fpref.o: $$srcfile" | tee "$$pofile" ; fi ; done ; done -all: fixbrokendependencies diff --git a/lib/exceptionhandler/Makefile.am b/lib/exceptionhandler/Makefile.am index 7b75ac039..46800311e 100644 --- a/lib/exceptionhandler/Makefile.am +++ b/lib/exceptionhandler/Makefile.am @@ -17,10 +17,3 @@ libexceptionhandler_a_SOURCES = \ if MINGW32 libexceptionhandler_a_SOURCES += exchndl.c endif - -# HACK Don't give make errors when switching between trunk and branches. -# Works by finding the .deps/*.Po files which refer to source files that don't exist, and replacing them with a single dependency on the correct source file. -# Now with PD-ksh support. -fixbrokendependencies: - mkdir -p ".deps" ; for ext in c cpp ; do for a in `cd $(srcdir) ; echo *.$$ext` ; do fpref="`echo "$$a" | sed "s/\.$$ext//"`" ; pofile=".deps/$$fpref.Po" ; srcfile="$(srcdir)/$$a" ; if [ -e "$$srcfile" ] && ! grep -q "\b$$a\b" "$$pofile" 2> /dev/null ; then echo "$$fpref.o: $$srcfile" | tee "$$pofile" ; fi ; done ; done -all: fixbrokendependencies diff --git a/lib/framework/Makefile.am b/lib/framework/Makefile.am index aa69ecd30..27cd5e1cd 100644 --- a/lib/framework/Makefile.am +++ b/lib/framework/Makefile.am @@ -92,10 +92,3 @@ libframework_a_SOURCES = \ treap.c \ trig.c \ utf.c - -# HACK Don't give make errors when switching between trunk and branches. -# Works by finding the .deps/*.Po files which refer to source files that don't exist, and replacing them with a single dependency on the correct source file. -# Now with PD-ksh support. -fixbrokendependencies: - mkdir -p ".deps" ; for ext in c cpp ; do for a in `cd $(srcdir) ; echo *.$$ext` ; do fpref="`echo "$$a" | sed "s/\.$$ext//"`" ; pofile=".deps/$$fpref.Po" ; srcfile="$(srcdir)/$$a" ; if [ -e "$$srcfile" ] && ! grep -q "\b$$a\b" "$$pofile" 2> /dev/null ; then echo "$$fpref.o: $$srcfile" | tee "$$pofile" ; fi ; done ; done -all: fixbrokendependencies diff --git a/lib/gamelib/Makefile.am b/lib/gamelib/Makefile.am index 2daf48b0e..7111d345d 100644 --- a/lib/gamelib/Makefile.am +++ b/lib/gamelib/Makefile.am @@ -43,10 +43,3 @@ libgamelib_a_SOURCES = \ libgamelib_a_LIBADD = $(top_builddir)/lib/ivis_opengl/libivis_opengl.a \ $(top_builddir)/lib/ivis_common/libivis_common.a $(top_builddir)/lib/framework/libframework.a - -# HACK Don't give make errors when switching between trunk and branches. -# Works by finding the .deps/*.Po files which refer to source files that don't exist, and replacing them with a single dependency on the correct source file. -# Now with PD-ksh support. -fixbrokendependencies: - mkdir -p ".deps" ; for ext in c cpp ; do for a in `cd $(srcdir) ; echo *.$$ext` ; do fpref="`echo "$$a" | sed "s/\.$$ext//"`" ; pofile=".deps/$$fpref.Po" ; srcfile="$(srcdir)/$$a" ; if [ -e "$$srcfile" ] && ! grep -q "\b$$a\b" "$$pofile" 2> /dev/null ; then echo "$$fpref.o: $$srcfile" | tee "$$pofile" ; fi ; done ; done -all: fixbrokendependencies diff --git a/lib/iniparser/Makefile.am b/lib/iniparser/Makefile.am index 9e517aeab..a5137e92a 100644 --- a/lib/iniparser/Makefile.am +++ b/lib/iniparser/Makefile.am @@ -5,10 +5,3 @@ noinst_LIBRARIES = libiniparser.a noinst_HEADERS = dictionary.h iniparser.h libiniparser_a_SOURCES = dictionary.c iniparser.c EXTRA_DIST = LICENSE AUTHORS - -# HACK Don't give make errors when switching between trunk and branches. -# Works by finding the .deps/*.Po files which refer to source files that don't exist, and replacing them with a single dependency on the correct source file. -# Now with PD-ksh support. -fixbrokendependencies: - mkdir -p ".deps" ; for ext in c cpp ; do for a in `cd $(srcdir) ; echo *.$$ext` ; do fpref="`echo "$$a" | sed "s/\.$$ext//"`" ; pofile=".deps/$$fpref.Po" ; srcfile="$(srcdir)/$$a" ; if [ -e "$$srcfile" ] && ! grep -q "\b$$a\b" "$$pofile" 2> /dev/null ; then echo "$$fpref.o: $$srcfile" | tee "$$pofile" ; fi ; done ; done -all: fixbrokendependencies diff --git a/lib/ivis_common/Makefile.am b/lib/ivis_common/Makefile.am index a882272c8..e53bc464d 100644 --- a/lib/ivis_common/Makefile.am +++ b/lib/ivis_common/Makefile.am @@ -32,10 +32,3 @@ libivis_common_a_SOURCES = \ png_util.c libivis_common_a_LIBADD = $(top_builddir)/lib/framework/libframework.a - -# HACK Don't give make errors when switching between trunk and branches. -# Works by finding the .deps/*.Po files which refer to source files that don't exist, and replacing them with a single dependency on the correct source file. -# Now with PD-ksh support. -fixbrokendependencies: - mkdir -p ".deps" ; for ext in c cpp ; do for a in `cd $(srcdir) ; echo *.$$ext` ; do fpref="`echo "$$a" | sed "s/\.$$ext//"`" ; pofile=".deps/$$fpref.Po" ; srcfile="$(srcdir)/$$a" ; if [ -e "$$srcfile" ] && ! grep -q "\b$$a\b" "$$pofile" 2> /dev/null ; then echo "$$fpref.o: $$srcfile" | tee "$$pofile" ; fi ; done ; done -all: fixbrokendependencies diff --git a/lib/ivis_opengl/Makefile.am b/lib/ivis_opengl/Makefile.am index 3863deea0..4c057599d 100644 --- a/lib/ivis_opengl/Makefile.am +++ b/lib/ivis_opengl/Makefile.am @@ -28,10 +28,3 @@ endif libivis_opengl_a_LIBADD = $(top_builddir)/lib/ivis_common/libivis_common.a \ $(top_builddir)/lib/framework/libframework.a - -# HACK Don't give make errors when switching between trunk and branches. -# Works by finding the .deps/*.Po files which refer to source files that don't exist, and replacing them with a single dependency on the correct source file. -# Now with PD-ksh support. -fixbrokendependencies: - mkdir -p ".deps" ; for ext in c cpp ; do for a in `cd $(srcdir) ; echo *.$$ext` ; do fpref="`echo "$$a" | sed "s/\.$$ext//"`" ; pofile=".deps/$$fpref.Po" ; srcfile="$(srcdir)/$$a" ; if [ -e "$$srcfile" ] && ! grep -q "\b$$a\b" "$$pofile" 2> /dev/null ; then echo "$$fpref.o: $$srcfile" | tee "$$pofile" ; fi ; done ; done -all: fixbrokendependencies diff --git a/lib/netplay/Makefile.am b/lib/netplay/Makefile.am index b351b287e..0e0096bfc 100644 --- a/lib/netplay/Makefile.am +++ b/lib/netplay/Makefile.am @@ -21,10 +21,3 @@ libnetplay_a_SOURCES = \ nettypes.cpp libnetplay_a_LIBADD = $(top_builddir)/lib/framework/libframework.a $(top_builddir)/lib/netplay/miniupnpc/libminiupnpc.a - -# HACK Don't give make errors when switching between trunk and branches. -# Works by finding the .deps/*.Po files which refer to source files that don't exist, and replacing them with a single dependency on the correct source file. -# Now with PD-ksh support. -fixbrokendependencies: - mkdir -p ".deps" ; for ext in c cpp ; do for a in `cd $(srcdir) ; echo *.$$ext` ; do fpref="`echo "$$a" | sed "s/\.$$ext//"`" ; pofile=".deps/$$fpref.Po" ; srcfile="$(srcdir)/$$a" ; if [ -e "$$srcfile" ] && ! grep -q "\b$$a\b" "$$pofile" 2> /dev/null ; then echo "$$fpref.o: $$srcfile" | tee "$$pofile" ; fi ; done ; done -all: fixbrokendependencies diff --git a/lib/netplay/miniupnpc/Makefile.am b/lib/netplay/miniupnpc/Makefile.am index c2e90c820..3dd93a501 100644 --- a/lib/netplay/miniupnpc/Makefile.am +++ b/lib/netplay/miniupnpc/Makefile.am @@ -29,10 +29,3 @@ libminiupnpc_a_SOURCES = \ upnperrors.c EXTRA_DIST = LICENCE README - -# HACK Don't give make errors when switching between trunk and branches. -# Works by finding the .deps/*.Po files which refer to source files that don't exist, and replacing them with a single dependency on the correct source file. -# Now with PD-ksh support. -fixbrokendependencies: - mkdir -p ".deps" ; for ext in c cpp ; do for a in `cd $(srcdir) ; echo *.$$ext` ; do fpref="`echo "$$a" | sed "s/\.$$ext//"`" ; pofile=".deps/$$fpref.Po" ; srcfile="$(srcdir)/$$a" ; if [ -e "$$srcfile" ] && ! grep -q "\b$$a\b" "$$pofile" 2> /dev/null ; then echo "$$fpref.o: $$srcfile" | tee "$$pofile" ; fi ; done ; done -all: fixbrokendependencies diff --git a/lib/script/Makefile.am b/lib/script/Makefile.am index 5e348a9a7..62adcabf5 100644 --- a/lib/script/Makefile.am +++ b/lib/script/Makefile.am @@ -57,10 +57,3 @@ libscript_a_SOURCES = \ stack.c libscript_a_LIBADD = $(top_builddir)/lib/framework/libframework.a - -# HACK Don't give make errors when switching between trunk and branches. -# Works by finding the .deps/*.Po files which refer to source files that don't exist, and replacing them with a single dependency on the correct source file. -# Now with PD-ksh support. -fixbrokendependencies: - mkdir -p ".deps" ; for ext in c cpp ; do for a in `cd $(srcdir) ; echo *.$$ext` ; do fpref="`echo "$$a" | sed "s/\.$$ext//"`" ; pofile=".deps/$$fpref.Po" ; srcfile="$(srcdir)/$$a" ; if [ -e "$$srcfile" ] && ! grep -q "\b$$a\b" "$$pofile" 2> /dev/null ; then echo "$$fpref.o: $$srcfile" | tee "$$pofile" ; fi ; done ; done -all: fixbrokendependencies diff --git a/lib/sequence/Makefile.am b/lib/sequence/Makefile.am index c7c855635..813b415af 100644 --- a/lib/sequence/Makefile.am +++ b/lib/sequence/Makefile.am @@ -10,10 +10,3 @@ noinst_HEADERS = \ libsequence_a_SOURCES = \ sequence.c \ timer.c - -# HACK Don't give make errors when switching between trunk and branches. -# Works by finding the .deps/*.Po files which refer to source files that don't exist, and replacing them with a single dependency on the correct source file. -# Now with PD-ksh support. -fixbrokendependencies: - mkdir -p ".deps" ; for ext in c cpp ; do for a in `cd $(srcdir) ; echo *.$$ext` ; do fpref="`echo "$$a" | sed "s/\.$$ext//"`" ; pofile=".deps/$$fpref.Po" ; srcfile="$(srcdir)/$$a" ; if [ -e "$$srcfile" ] && ! grep -q "\b$$a\b" "$$pofile" 2> /dev/null ; then echo "$$fpref.o: $$srcfile" | tee "$$pofile" ; fi ; done ; done -all: fixbrokendependencies diff --git a/lib/sound/Makefile.am b/lib/sound/Makefile.am index f66dcbf70..99045974a 100644 --- a/lib/sound/Makefile.am +++ b/lib/sound/Makefile.am @@ -27,10 +27,3 @@ libsound_a_SOURCES = \ libsound_a_LIBADD = $(top_builddir)/lib/gamelib/libgamelib.a \ $(top_builddir)/lib/framework/libframework.a - -# HACK Don't give make errors when switching between trunk and branches. -# Works by finding the .deps/*.Po files which refer to source files that don't exist, and replacing them with a single dependency on the correct source file. -# Now with PD-ksh support. -fixbrokendependencies: - mkdir -p ".deps" ; for ext in c cpp ; do for a in `cd $(srcdir) ; echo *.$$ext` ; do fpref="`echo "$$a" | sed "s/\.$$ext//"`" ; pofile=".deps/$$fpref.Po" ; srcfile="$(srcdir)/$$a" ; if [ -e "$$srcfile" ] && ! grep -q "\b$$a\b" "$$pofile" 2> /dev/null ; then echo "$$fpref.o: $$srcfile" | tee "$$pofile" ; fi ; done ; done -all: fixbrokendependencies diff --git a/lib/widget/Makefile.am b/lib/widget/Makefile.am index 38be18459..03eb125af 100644 --- a/lib/widget/Makefile.am +++ b/lib/widget/Makefile.am @@ -29,10 +29,3 @@ libwidget_a_SOURCES = \ libwidget_a_LIBADD = $(top_builddir)/lib/ivis_opengl/libivis_opengl.a \ $(top_builddir)/lib/ivis_common/libivis_common.a $(top_builddir)/lib/framework/libframework.a - -# HACK Don't give make errors when switching between trunk and branches. -# Works by finding the .deps/*.Po files which refer to source files that don't exist, and replacing them with a single dependency on the correct source file. -# Now with PD-ksh support. -fixbrokendependencies: - mkdir -p ".deps" ; for ext in c cpp ; do for a in `cd $(srcdir) ; echo *.$$ext` ; do fpref="`echo "$$a" | sed "s/\.$$ext//"`" ; pofile=".deps/$$fpref.Po" ; srcfile="$(srcdir)/$$a" ; if [ -e "$$srcfile" ] && ! grep -q "\b$$a\b" "$$pofile" 2> /dev/null ; then echo "$$fpref.o: $$srcfile" | tee "$$pofile" ; fi ; done ; done -all: fixbrokendependencies diff --git a/src/Makefile.am b/src/Makefile.am index de4080f1a..3e36a95de 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -305,10 +305,3 @@ warzone2100_LDADD += $(LTLIBINTL) $(SDL_LIBS) $(PHYSFS_LIBS) $(PNG_LIBS) $(OGGVO if MINGW32 warzone2100_LDADD += $(top_builddir)/win32/warzone2100.o $(WIN32_LIBS) endif - -# HACK Don't give make errors when switching between trunk and branches. -# Works by finding the .deps/*.Po files which refer to source files that don't exist, and replacing them with a single dependency on the correct source file. -# Now with PD-ksh support. -fixbrokendependencies: - mkdir -p ".deps" ; for ext in c cpp ; do for a in `cd $(srcdir) ; echo *.$$ext` ; do fpref="`echo "$$a" | sed "s/\.$$ext//"`" ; pofile=".deps/$$fpref.Po" ; srcfile="$(srcdir)/$$a" ; if [ -e "$$srcfile" ] && ! grep -q "\b$$a\b" "$$pofile" 2> /dev/null ; then echo "$$fpref.o: $$srcfile" | tee "$$pofile" ; fi ; done ; done -all: fixbrokendependencies