comp.lang.ada
 help / color / mirror / Atom feed
From: duz@roxi.rz.fht-mannheim.de (Dirk Zoller)
Subject: Re: ada-mode problems
Date: Wed, 21 Dec 94 22:11:04 CET
Date: 1994-12-21T22:11:04+01:00	[thread overview]
Message-ID: <1994Dec21.221104.23859@roxi.rz.fht-mannheim.de> (raw)
In-Reply-To: 3d75gg$lid@kaiwan009.kaiwan.com

Hello,


David D. Shochat (dshochat@kaiwan009.kaiwan.com) wrote:
: emacs 19.28
: ada-mode 2.8 from cs.nyu.edu /pub/gnat

I use the same versions and are relatively happy.

: Some things do seem to work (e.g. indentation).
Not perfectly. It gets confused after a use statement inside a package body.
E.g.
	package body blabla is
	   package int_io is new integer_io (integer);
	   use int_io;

now the indentation is completely different from what it would be
without the use clause.

: But when I try to
: use the compile command from the Ada menu, I just get a "make -k"
: prompt in the minibuffer. I tried changing it to gcc -c, but then
: it didn't insert the file name.

I suspect you are on the wrong trail here. It would be better if you
could rely on make to know how to make an executable from Ada sources.
Unfortunately you can't yet.

If you have a C-source xyz.c and want to have the executable xyz then
you can simply say make xyz. That's why emacs suggests the "make -k"
command line.

I use the following Makefile to achieve a similar effect with ada
sources too. It declares a few new "pattern rules" (works only with
GNU-make).

=======================================================================
#
# Makefile --- Makefile for GNU-make, make executables from Ada sources
#

# for OS/2 use:
O       = .obj
E       = .exe

# for Unices use:
ifdef HOSTNAME # a variable only defined in unix
O       = .o
E       = 
endif

CC      = gcc
ADAC    = $(CC)
GF      = -O2 -fomit-frame-pointer
BF      = -s

%.ali %$O : %.ads %.adb
		$(ADAC) -c $(GF) $*.adb

%.ali %$O : %.adb
		$(ADAC) -c $(GF) $<

%.s : %.adb
		$(ADAC) -S $(GF) $< -o $@

%$O : %.c
		$(CC) -c $(CFLAGS) $< -o $@

%.s : %.c
		$(CC) -S $(CFLAGS) $< -o $@

%$E : %.ali %$O
		gnatbl $(BF) $< -o $@
=======================================================================
(Don't cut/paste this text from an xterm, the tabs are important!)

Note that this Makefile doesn't contain any target. You can include it
in your Makefiles and add targets or simply say "make target" when
there is a target.adb source.

There are a few rules to build executables from multiple sources. The
dependency is chained using the *.ali files GNAT produces along with
the objects.

What more good ideas on using make with GNAT do you have?

Dirk
---
duz@roxi.rz.fht-mannheim.de <Dirk Zoller>



  reply	other threads:[~1994-12-21 21:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-12-08 21:57 HELP!!!! How do you modify the font-lock-mode for ada-mode!! Al Niessner III
1994-12-09 21:49 ` Rolf Ebert
1994-12-20 17:50   ` ada-mode problems David D. Shochat
1994-12-21 21:11     ` Dirk Zoller [this message]
1994-12-10  5:07 ` HELP!!!! How do you modify the font-lock-mode for ada-mode!! Cyrille Comar
replies disabled

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