From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Emacs Ada mode with RTS References: <888a3bd7-6ce8-4458-8725-8330680f48de@googlegroups.com> <86egl9do8p.fsf@stephe-leake.org> <8a492b13-7f08-4597-aa14-5aa8715850f5@googlegroups.com> <86ioajaiyu.fsf@stephe-leake.org> Date: Sun, 21 Jun 2015 04:48:12 -0500 Message-ID: <86h9q12y03.fsf@stephe-leake.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt) Cancel-Lock: sha1:e7/WFLbkoavcpc9xbofKPD9KiUE= MIME-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 68b655586885ee97f808415390 X-Received-Bytes: 2359 X-Received-Body-CRC: 2983386768 Xref: news.eternal-september.org comp.lang.ada:26394 Date: 2015-06-21T04:48:12-05:00 List-Id: Patrick Noffke 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