comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: Emacs Ada mode with RTS
Date: Sun, 21 Jun 2015 04:48:12 -0500
Date: 2015-06-21T04:48:12-05:00	[thread overview]
Message-ID: <86h9q12y03.fsf@stephe-leake.org> (raw)
In-Reply-To: bcced90e-9010-4307-bc1f-f5036fcab40f@googlegroups.com

Patrick Noffke <patrick.noffke@gmail.com> writes:

> On Friday, June 19, 2015 at 9:09:01 AM UTC-5, Stephen Leake wrote:
>> Patrick Noffke writes:
>>
>> > Is there a way to make ada-mode's Check syntax
>> > or Build commands dependent on a rule (i.e. generating the config
>> > file) in my Makefile?
>>
>> I'm not sure what you are asking.
>>
>> When I use a Makefile, I put check and build targets in there; I never
>> use the Ada | Build menu.
>>
>> You can set the Ada | Build | Check command to run 'make check' in your .adp:
>>
>> check_cmd=make check
>>
>
> If I want to use the Ada | Build | Check syntax command to check that
> a single file compiles, then I would need to first ensure the config
> file is created with gprconfig (i.e. as a make dependency).

In the 'check_cmd' string, "${full_current}" is replaced by the current
file name:

check_cmd=make check SOURCE_FILE=${full_current}

Then you have a makefile rule like:

check : $(SOURCE_FILE)
    gnatmake -gnatc -P$(GNAT_PROJECT) $<

This assumes GNAT_PROJECT is set elsewhere in the Makefile.

Note that this will also syntax-check any files that SOURCE_FILE
"with"s; I find that useful.

There should be a similar option for gprbuild, but I have not found a
need for it yet.



Alternately, you can use a makefile target like:

%.check : %.adb
    gnatmake -gnatc -P$(GNAT_PROJECT) $*


Then to check a single file foo.adb, from the Makefile do:

M-x compile
make -r foo.check

--
-- Stephe


      reply	other threads:[~2015-06-21  9:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-17 18:12 Emacs Ada mode with RTS Patrick Noffke
2015-06-17 21:30 ` Simon Wright
2015-06-18 13:48   ` Patrick Noffke
2015-06-18 14:06     ` Simon Wright
2015-06-18 15:09       ` Patrick Noffke
2015-06-18 15:21         ` Patrick Noffke
2015-06-19 13:56       ` Stephen Leake
2015-06-18 15:34 ` Stephen Leake
2015-06-18 18:19   ` Patrick Noffke
2015-06-19 14:01     ` Stephen Leake
2015-06-18 18:39   ` Patrick Noffke
2015-06-18 19:19     ` Simon Wright
2015-06-19 14:12       ` Stephen Leake
2015-06-19 19:19         ` Simon Wright
2015-06-19 14:08     ` Stephen Leake
2015-06-19 14:47       ` Patrick Noffke
2015-06-21  9:48         ` Stephen Leake [this message]
replies disabled

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