Compiling Ada - confused about nmake.{adb,ads}

Billinghurst, David (CRTS) David.Billinghurst@riotinto.com
Wed Oct 10 06:39:00 GMT 2001


Partial success compiling Ada on a i686-pc-linux-gnu host (Red Hat 7.1),
bootstrapping with gnat-3.13p-7 rpm from www.gnuada.org.

The build fails with 

mkdir -p bldtools
cp -p /home/billingd/src/gcc/gcc/ada/sinfo.ads
/home/billingd/src/gcc/gcc/ada/nmake.adt
/home/billingd/src/gcc/gcc/ada/xnmake.adb bldtools
(cd bldtools; gnatmake -q xnmake ; ./xnmake -s ../nmake.ads )
mkdir -p bldtools
cp -p /home/billingd/src/gcc/gcc/ada/sinfo.ads
/home/billingd/src/gcc/gcc/ada/nmake.adt
/home/billingd/src/gcc/gcc/ada/xnmake.adb bldtools
(cd bldtools; gnatmake -q xnmake ; ./xnmake -b ../nmake.adb )
gnatgcc -c -g    -W -Wall -gnatpg -gnata -I- -I.
-I/home/billingd/src/gcc/gcc/ada /home/billingd/src/gcc/gcc/ada/checks.adb
checks.adb:38:06: file "nmake.ads" does not contain expected unit
checks.adb:38:06: expected unit "Nmake (spec)"
checks.adb:38:06: found unit "Nmake (body)"
compilation abandoned


Sure enough, in directory $(objdir)/gcc/ada the file nmake.adb contains the
specification while nmake.ads contains the body.  Swapping these two files
allows the bootstrap to continue.

The makefile rules are:

nmake.adb : sinfo.ads nmake.adt xnmake.adb
	-$(MKDIR) bldtools
	$(CP) $^ bldtools
	(cd bldtools; gnatmake -q xnmake ; ./xnmake -b ../nmake.adb )

nmake.ads :  sinfo.ads nmake.adt xnmake.adb
	-$(MKDIR) bldtools
	$(CP) $^ bldtools
	(cd bldtools; gnatmake -q xnmake ; ./xnmake -s ../nmake.ads )


Somewhat counter-intuitively, on my system 

	"xnmake -s filename" generates the body
	"xnmake -b filename" generates the specification


In addition, I now have three copies of these files, in:
 - $(srcdir)/gcc/ada
 - $(objdir)/gcc/ada
 - $(objdir)/gcc/ada/bldtools



More information about the Gcc-bugs mailing list