[MPlayer-dev-eng] [PATCH] Moving help_mp.h generation to makefile

Torinthiel torinthiel at megapolis.pl
Sun Oct 10 18:36:43 CEST 2004


Right now the help_mp.h file is generated only every time ./configure is run.
This has an ill effect that, if one uses any translation instead of the English messages and
someone adds a new message which is (yet) missing in translation, the
compilation is broken until he regenerates the help file either manually
or by re-running ./configure (which wouldn't be necessary otherwise).
This patch addresses the issue by moving help_mp.h generation to
Makefile.
There is one issue with it, help_mp.h has to be generated really fast,
but I'm not sure if making everything depend on it just like version.h
is a good idea. dep is made dependent on help_mp.h because otherwise
make dep fails.
Any comments?
Torinthiel

-- 
 Waclaw "Torinthiel" Schiller       GG#: 542916, 3073512
   torinthiel(at)megapolis(dot)pl
   gpg: B06901F1 fpr: FAA3 559F CAE9 34DE CDC8  7346 2B6E 39F2 B069 01F1
 "No classmates may be used during this examination"
-------------- next part --------------
Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/configure,v
retrieving revision 1.917
diff -u -r1.917 configure
--- configure	7 Oct 2004 09:31:15 -0000	1.917
+++ configure	10 Oct 2004 16:36:12 -0000
@@ -6273,6 +6273,7 @@
 EXTRA_INC = $_inc_extra $_inc_gtk
 OPTFLAGS = -I../libvo -I../../libvo $_inc_x11 $CFLAGS \$(EXTRA_INC)
 STRIPBINARIES = $_stripbinaries
+HELP_FILE = $_mp_help
 
 PRG = $_prg
 PRG_MENCODER = $_prg_mencoder
@@ -7058,23 +7059,6 @@
 
 #############################################################################
 
-echo "Creating help_mp.h"
-cat > help_mp.h << EOF
-//
-// WARNING! This is a generated file. Do NOT edit.
-// See the help/ subdir for the editable files.
-//
-#include "$_mp_help"
-EOF
-
-if test $_mp_help != "help/help_mp-en.h"; then
-  echo "Adding untranslated messages to help_mp.h"
-  echo '// untranslated messages from the english master-file:' >> help_mp.h
-  help/help_diff.sh $_mp_help <help/help_mp-en.h >> help_mp.h
-fi
-
-#############################################################################
-
 cat << EOF
 
 Config files successfully generated by ./configure !
Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/Makefile,v
retrieving revision 1.304
diff -u -r1.304 Makefile
--- Makefile	7 Oct 2004 09:31:15 -0000	1.304
+++ Makefile	10 Oct 2004 16:36:12 -0000
@@ -262,8 +262,9 @@
 # run.  This is necessary, because the make rule for version.h removes objects
 # in a recursive "make distclean" and we must wait for this "make distclean" to
 # finish before we can start building new object files.
-$(MPLAYER_DEP): version.h
-$(MENCODER_DEP): version.h
+# help_mp.h is also required by a lot of files, so force generating it really fast.
+$(MPLAYER_DEP): version.h help_mp.h
+$(MENCODER_DEP): version.h help_mp.h
 
 $(PRG_CFG): version.h codec-cfg.c codec-cfg.h
 	$(HOST_CC) $(CFLAGS) -g codec-cfg.c mp_msg.c -o $(PRG_CFG) -DCODECS2HTML $(EXTRA_LIB) $(I18NLIBS)
@@ -339,7 +340,7 @@
 
 dep:	depend
 
-depend:
+depend: help_mp.h
 	./version.sh `$(CC) -dumpversion`
 	$(CC) -MM $(CFLAGS) -DCODECS2HTML mplayer.c mencoder.c $(SRCS_MPLAYER) $(SRCS_MENCODER) 1>.depend
 	@for a in $(PARTS); do $(MAKE) -C $$a dep; done
@@ -369,6 +370,17 @@
 doxygen_clean:
 	-rm -rf DOCS/tech/doxygen
 
+help_mp.h: help/help_mp-en.h $(HELP_FILE)
+	@echo '// WARNING! This is a generated file. Do NOT edit.' > help_mp.h
+	@echo '// See the help/ subdir for the editable files.' >> help_mp.h
+	@echo '#include "$(HELP_FILE)"' >> help_mp.h
+
+ifneq ($(HELP_FILE),help/help_mp-en.h)
+	@echo "Adding untranslated messages to help_mp.h"
+	@echo '// untranslated messages from the english master-file:' >> help_mp.h
+	@help/help_diff.sh $(HELP_FILE) < help/help_mp-en.h >> help_mp.h
+endif
+
 # rebuild at every CVS update or config/makefile change:
 ifeq ($(wildcard .developer),)
 ifneq ($(wildcard CVS/Entries),)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20041010/0babe954/attachment.pgp>


More information about the MPlayer-dev-eng mailing list