This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RFA: fix in features/Makefile
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Sun, 24 Aug 2008 12:11:03 -0600
- Subject: RFA: fix in features/Makefile
- Reply-to: tromey at redhat dot com
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: