Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFA: fix in features/Makefile
@ 2008-08-24 18:12 Tom Tromey
  2008-08-24 22:38 ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Tromey @ 2008-08-24 18:12 UTC (permalink / raw)
  To: gdb-patches

When regenerating some files in features using features/Makefile, I
saw some strange control characters show up at the start of the
generated files.

This patch changes features/Makefile to use gdb's logging feature
rather than redirection to create the output files.  This fixed the
problem I saw.

This patch also makes it so that the .c files are always rebuilt in
response to a 'make'.  Without the FORCE code, make was not running
the rule for me.

Ok?


Also, it would be nice if someone documented which .xml->.c
translations are to be checked in.  I ran the rule with XMLTOC set to
all the .xml files under features, and I got a bunch of new files that
aren't in the repository.  IMO the canonical list ought to be set in
features/Makefile somewhere.

Tom

:ADDPATCH maintenance:

ChangeLog:
2008-08-24  Tom Tromey  <tromey@redhat.com>

	* features/Makefile (%.c): Depend on FORCE.  Use logging, not
	redirection, to create the output file.
	(FORCE): New target.
	(.PHONY): Likewise.

Index: features/Makefile
===================================================================
RCS file: /cvs/src/src/gdb/features/Makefile,v
retrieving revision 1.9
diff -u -r1.9 Makefile
--- features/Makefile	15 Aug 2008 15:18:33 -0000	1.9
+++ features/Makefile	24 Aug 2008 18:07:59 -0000
@@ -70,10 +70,19 @@
 	sh ../../move-if-change $(outdir)/$*.tmp $(outdir)/$*.dat
 
 cfiles: $(CFILES)
-%.c: %.xml
+%.c: %.xml FORCE
 	$(GDB) -nx -q -batch \
-	  -ex "set tdesc filename $<" -ex 'maint print c-tdesc' > $@.tmp
+	  -ex 'set logging overwrite on' \
+	  -ex "set logging file $@.tmp" \
+	  -ex 'set logging redirect on' \
+	  -ex "set tdesc filename $<" \
+	  -ex 'set logging on' \
+	  -ex 'maint print c-tdesc' \
+	  -ex 'set logging off'
 	sh ../../move-if-change $@.tmp $@
 
 # Other dependencies.
 $(outdir)/arm-with-iwmmxt.dat: arm-core.xml xscale-iwmmxt.xml
+
+.PHONY: cfiles
+FORCE:


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-10-06 20:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-24 18:12 RFA: fix in features/Makefile Tom Tromey
2008-08-24 22:38 ` Daniel Jacobowitz
2008-08-25  0:03   ` Tom Tromey
2008-08-25  2:36     ` Daniel Jacobowitz
2008-08-25  4:04       ` Tom Tromey
2008-08-25 12:12         ` Daniel Jacobowitz
2008-10-06 20:39           ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox