opcodes: more build fixes

Ralf Wildenhues Ralf.Wildenhues@gmx.de
Sun Aug 23 09:59:00 GMT 2009


Noticed that a couple of objects didn't get their dependency tracked
properly (they were recorded below .deps/, but the depfiles were not
included by the Makefile):
  opcodes/.deps/i386-gen.Po
  opcodes/.deps/ia64-gen.Po
  opcodes/.deps/msp430-dis.Plo

The first two are due to automake thinking they are created with
libtool, thus only their *.Plo files were included, not the *.Po ones.

msp430-dis is listed in CFILES but not in ALL_MACHINES (which is what
killed the dep tracking for that file).  Having to list things twice
without a consistency check is not a good idea, so I compared the two
lists and factorized them so we have to list each file once only:

CFILES contains all .c files corresponding to the .lo files listed in
ALL_MACHINES, plus these:
  dis-buf.c
  dis-init.c
  disassemble.c
  ia64-opc-a.c
  ia64-opc-b.c
  ia64-opc-f.c
  ia64-opc-i.c
  ia64-opc-m.c
  ia64-opc-d.c
  ia64-asmtab.c
  s390-mkopc.c
  z8kgen.c

The first three of those (dis*.c) are already listed in
libopcodes_la_SOURCES, so that difference is only relevant for POTFILES.

The ia64-*.c files are all generator files, as is s390-mkopc.c, so it's
right for them to not end up in libopcodes.

z8kgen.c documents to generate z8k-opc.h, but there is no
accompanying rule for this.  Intentional omission?

The patch below does the factorizes based on these observations.
Somebody should write a rule for z8kgen and z8k-opc.h (protecting
prerequisites with @MAINT@ I suppose).

OK to commit?

Note the po/POTFILES.in regen adds msp430-dis.c.

Also, do I assume correctly that i386-gen and ia64-gen only work
correctly in non-cross-compile situations, and are thus only enabled
in maintainer-mode?  Because otherwise you wouldn't necessarily be able
to execute code not compiled with CC_FOR_BUILD.  If that were to be
changed (similar to how s390-opc.c is created), then the dependency
tracking wouldn't necessarily work any more for files compiled with
this.

Thanks!
Ralf

opcodes/ChangeLog:
2009-08-23  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* Makefile.am (TARGET_LIBOPCODES_CFILES): New variable, taken
	from $(CFILES), sorted, with dis-buf.c, dis-init.c, disassemble.c,
	i386-gen.c, ia64-opc-a.c, ia64-opc-b.c, ia64-opc-f.c, ia64-opc-i.c,
	ia64-opc-m.c, ia64-opc-d.c, ia64-gen.c, ia64-asmtab.c removed, and
	msp430-dis.c added.
	(LIBOPCODES_CFILES): New variable, adding to
	TARGET_LIBOPCODES_CFILES also non-target library sources.
	(CFILES): Factorize based on $(LIBOPCODES_CFILES), adding generator
	files.
	(ALL_MACHINES): Factorize based on $(TARGET_LIBOPCODES_CFILES).
	(EXTRA_libopcodes_la_SOURCES): Use $(LIBOPCODES_CFILES).
	(i386-gen, ia64-gen): Remove.
	(noinst_PROGRAMS, i386_gen_LDADD, ia64_gen_LDADD): New variables.
	* Makefile.in: Regenerate.
	* po/POTFILES.in: Regenerate.

Index: opcodes/Makefile.am
===================================================================
RCS file: /cvs/src/src/opcodes/Makefile.am,v
retrieving revision 1.143
diff -u -r1.143 Makefile.am
--- opcodes/Makefile.am	22 Aug 2009 19:02:57 -0000	1.143
+++ opcodes/Makefile.am	23 Aug 2009 09:34:15 -0000
@@ -61,13 +61,14 @@
 	xstormy16-desc.h xstormy16-opc.h \
 	z8k-opc.h
 
-# C source files that correspond to .o's.
-CFILES = \
+# C source files that correspond to .o's ending up in libopcodes
+# for all machines.
+TARGET_LIBOPCODES_CFILES = \
 	alpha-dis.c \
 	alpha-opc.c \
 	arc-dis.c \
-	arc-opc.c \
 	arc-ext.c \
+	arc-opc.c \
 	arm-dis.c \
 	avr-dis.c \
 	bfin-dis.c \
@@ -86,9 +87,6 @@
 	d30v-dis.c \
 	d30v-opc.c \
 	dlx-dis.c \
-	dis-buf.c \
-	dis-init.c \
-	disassemble.c \
 	fr30-asm.c \
 	fr30-desc.c \
 	fr30-dis.c \
@@ -99,8 +97,6 @@
 	frv-dis.c \
 	frv-ibld.c \
 	frv-opc.c \
-	moxie-dis.c \
-	moxie-opc.c \
 	h8300-dis.c \
 	h8500-dis.c \
 	hppa-dis.c \
@@ -108,19 +104,10 @@
 	i370-opc.c \
 	i386-dis.c \
 	i386-opc.c \
-	i386-gen.c \
 	i860-dis.c \
 	i960-dis.c \
 	ia64-dis.c \
-	ia64-opc-a.c \
-	ia64-opc-b.c \
-	ia64-opc-f.c \
-	ia64-opc-i.c \
-	ia64-opc-m.c \
-	ia64-opc-d.c \
 	ia64-opc.c \
-	ia64-gen.c \
-	ia64-asmtab.c \
 	ip2k-asm.c \
 	ip2k-desc.c \
 	ip2k-dis.c \
@@ -137,6 +124,10 @@
 	lm32-ibld.c \
 	lm32-opc.c \
 	lm32-opinst.c \
+	m10200-dis.c \
+	m10200-opc.c \
+	m10300-dis.c \
+	m10300-opc.c \
 	m32c-asm.c \
 	m32c-desc.c \
 	m32c-dis.c \
@@ -160,16 +151,15 @@
 	mep-dis.c \
 	mep-ibld.c \
 	mep-opc.c \
-	mips-dis.c \
 	microblaze-dis.c \
+	mips-dis.c \
 	mips-opc.c \
 	mips16-opc.c \
-	m10200-dis.c \
-	m10200-opc.c \
-	m10300-dis.c \
-	m10300-opc.c \
 	mmix-dis.c \
 	mmix-opc.c \
+	moxie-dis.c \
+	moxie-opc.c \
+	msp430-dis.c \
 	mt-asm.c \
 	mt-desc.c \
 	mt-dis.c \
@@ -189,9 +179,8 @@
 	pj-opc.c \
 	ppc-dis.c \
 	ppc-opc.c \
-	s390-mkopc.c \
-	s390-opc.c \
 	s390-dis.c \
+	s390-opc.c \
 	score-dis.c \
 	score7-dis.c \
 	sh-dis.c \
@@ -223,159 +212,31 @@
 	xstormy16-opc.c \
 	xtensa-dis.c \
 	z80-dis.c \
-	z8k-dis.c \
+	z8k-dis.c
+
+# C source files that correspond to .o's ending up in libopcodes.
+LIBOPCODES_CFILES = \
+	$(TARGET_LIBOPCODES_CFILES) \
+	dis-buf.c \
+	dis-init.c \
+	disassemble.c
+
+# C source files that correspond to .o's.
+CFILES = \
+	$(LIBOPCODES_CFILES) \
+	i386-gen.c \
+	ia64-asmtab.c \
+	ia64-gen.c \
+	ia64-opc-a.c \
+	ia64-opc-b.c \
+	ia64-opc-f.c \
+	ia64-opc-i.c \
+	ia64-opc-m.c \
+	ia64-opc-d.c \
+	s390-mkopc.c \
 	z8kgen.c
 
-ALL_MACHINES = \
-	alpha-dis.lo \
-	alpha-opc.lo \
-	arc-dis.lo \
-	arc-opc.lo \
-	arc-ext.lo \
-	arm-dis.lo \
-	avr-dis.lo \
-	bfin-dis.lo \
-	cgen-asm.lo \
-	cgen-bitset.lo \
-	cgen-dis.lo \
-	cgen-opc.lo \
-	cr16-dis.lo \
-	cr16-opc.lo \
-	cris-dis.lo \
-	cris-opc.lo \
-	crx-dis.lo \
-	crx-opc.lo \
-	d10v-dis.lo \
-	d10v-opc.lo \
-	d30v-dis.lo \
-	d30v-opc.lo \
-	dlx-dis.lo \
-	fr30-asm.lo \
-	fr30-desc.lo \
-	fr30-dis.lo \
-	fr30-ibld.lo \
-	fr30-opc.lo \
-	frv-asm.lo \
-	frv-desc.lo \
-	frv-dis.lo \
-	frv-ibld.lo \
-	frv-opc.lo \
-	moxie-dis.lo \
-	moxie-opc.lo \
-	h8300-dis.lo \
-	h8500-dis.lo \
-	hppa-dis.lo \
-	i386-dis.lo \
-	i386-opc.lo \
-	i370-dis.lo \
-	i370-opc.lo \
-	i860-dis.lo \
-	i960-dis.lo \
-	ia64-dis.lo \
-	ia64-opc.lo \
-	ip2k-asm.lo \
-	ip2k-desc.lo \
-	ip2k-dis.lo \
-	ip2k-ibld.lo \
-	ip2k-opc.lo \
-	iq2000-asm.lo \
-	iq2000-desc.lo \
-	iq2000-dis.lo \
-	iq2000-ibld.lo \
-	iq2000-opc.lo \
-	lm32-asm.lo \
-	lm32-desc.lo \
-	lm32-dis.lo \
-	lm32-ibld.lo \
-	lm32-opc.lo \
-	lm32-opinst.lo \
-	m32c-asm.lo \
-	m32c-desc.lo \
-	m32c-dis.lo \
-	m32c-ibld.lo \
-	m32c-opc.lo \
-	m32r-asm.lo \
-	m32r-desc.lo \
-	m32r-dis.lo \
-	m32r-ibld.lo \
-	m32r-opc.lo \
-	m32r-opinst.lo \
-	m68hc11-dis.lo \
-	m68hc11-opc.lo \
-	m68k-dis.lo \
-	m68k-opc.lo \
-	m88k-dis.lo \
-	m10200-dis.lo \
-	m10200-opc.lo \
-	m10300-dis.lo \
-	m10300-opc.lo \
-	maxq-dis.lo \
-	mcore-dis.lo \
-	mep-asm.lo \
-	mep-desc.lo \
-	mep-dis.lo \
-	mep-ibld.lo \
-	mep-opc.lo \
-	mips-dis.lo \
-	microblaze-dis.lo \
-	mips-opc.lo \
-	mips16-opc.lo \
-	mmix-dis.lo \
-	mmix-opc.lo \
-	msp430-dis.lo \
-	mt-asm.lo \
-	mt-desc.lo \
-	mt-dis.lo \
-	mt-ibld.lo \
-	mt-opc.lo \
-	ns32k-dis.lo \
-	openrisc-asm.lo \
-	openrisc-desc.lo \
-	openrisc-dis.lo \
-	openrisc-ibld.lo \
-	openrisc-opc.lo \
-	or32-dis.lo \
-	or32-opc.lo \
-	pdp11-dis.lo \
-	pdp11-opc.lo \
-	pj-dis.lo \
-	pj-opc.lo \
-	ppc-dis.lo \
-	ppc-opc.lo \
-	s390-dis.lo \
-	s390-opc.lo \
-	score-dis.lo \
-	score7-dis.lo \
-	sh-dis.lo \
-	sh64-dis.lo \
-	sh64-opc.lo \
-	sparc-dis.lo \
-	sparc-opc.lo \
-	spu-dis.lo \
-	spu-opc.lo \
-	tic30-dis.lo \
-	tic4x-dis.lo \
-	tic54x-dis.lo \
-	tic54x-opc.lo \
-	tic80-dis.lo \
-	tic80-opc.lo \
-	v850-dis.lo \
-	v850-opc.lo \
-	vax-dis.lo \
-	w65-dis.lo \
-	xc16x-asm.lo \
-	xc16x-desc.lo \
-	xc16x-dis.lo \
-	xc16x-ibld.lo \
-	xc16x-opc.lo \
-	xstormy16-asm.lo \
-	xstormy16-desc.lo \
-	xstormy16-dis.lo \
-	xstormy16-ibld.lo \
-	xstormy16-opc.lo \
-	xtensa-dis.lo \
-	z80-dis.lo \
-	z8k-dis.lo
+ALL_MACHINES = $(TARGET_LIBOPCODES_CFILES:.c=.lo)
 
 OFILES = @BFD_MACHINES@
 
@@ -408,7 +269,7 @@
 libopcodes_la_LIBADD = $(OFILES) @SHARED_LIBADD@
 libopcodes_la_LDFLAGS += -release `cat ../bfd/libtool-soversion` @SHARED_LDFLAGS@
 # Allow dependency tracking to work on all the source files.
-EXTRA_libopcodes_la_SOURCES = $(CFILES)
+EXTRA_libopcodes_la_SOURCES = $(LIBOPCODES_CFILES)
 
 # libtool will build .libs/libopcodes.a.  We create libopcodes.a in
 # the build directory so that we don't have to convert all the
@@ -577,8 +438,8 @@
 	$(MAKE) run-cgen arch=xc16x prefix=xc16x options= \
 		archfile=$(CPUDIR)/xc16x.cpu opcfile=$(CPUDIR)/xc16x.opc extrafiles=
 
-i386-gen: i386-gen.o
-	$(LINK) i386-gen.o $(LIBIBERTY)
+noinst_PROGRAMS = i386-gen
+i386_gen_LDADD = $(LIBIBERTY)
 
 $(srcdir)/i386-tbl.h: $(srcdir)/i386-init.h 
 	@echo $@
@@ -586,8 +447,8 @@
 $(srcdir)/i386-init.h: @MAINT@ i386-gen i386-opc.tbl i386-reg.tbl
 	./i386-gen --srcdir $(srcdir)
 
-ia64-gen: ia64-gen.o
-	$(LINK) ia64-gen.o $(LIBIBERTY)
+noinst_PROGRAMS += ia64-gen
+ia64_gen_LDADD = $(LIBIBERTY)
 
 # Don't wrap the line below, as @MAINT@ can be expanded to '#'.
 # Some make versions don't handle line continuations in comments.



More information about the Binutils mailing list