all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: bvraghav@iitk.ac.in (B.V. Raghav)
To: Francis Belliveau <f.belliveau@comcast.net>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Compilation in C and ADA
Date: Wed, 20 Jul 2016 10:00:14 +0530	[thread overview]
Message-ID: <87y44xors9.fsf@ram.bvr.dp.lan> (raw)
In-Reply-To: <4781A7A0-F110-47CC-A19D-0C9F1619FD23@comcast.net> (Francis Belliveau's message of "Tue, 19 Jul 2016 22:50:12 -0400")

Francis Belliveau <f.belliveau@comcast.net> writes:
[...]
> I am no emacs expert, but from the evidence it seems clear to me that
> the emacs "compile" default is to make an entire application, not just
> compile a single file or the current buffer.
>
`C-h f compile' details out how I can build over the compile command to
	suit my needs. 

For a higher order automation, here is an excerpt from `Info > ede >
Building and Debugging' (C-h i m ede RET m build TAB RET)

#+BEGIN_QUOTE

  EDE provides the following “project-aware” compilation and debugging
  commands:

  ‘C-c . c’
       Compile the current target (‘ede-compile-target’).
  ‘C-c . C’
       Compile the entire project (‘ede-compile-project’).
  ‘c-c . D’
       Debug the current target (‘ede-debug-target’).
  ‘M-x ede-make-dist’
       Build a distribution file for your project.

     These commands are also available from the ‘Development’ menu.

#+END_QUOTE

> It has been a long time since I used Ada, so I cannot speak to how Ada
> applications are built these days, but I expect "make" can be used to
> do it.
>
Eitherways, it seems to be `configurable' into my project system.
https://gcc.gnu.org/onlinedocs/gnat_ugn/Running-a-Simple-Ada-Program.html

> However, both C and C++ developers commonly use make, or one of its
> many flavors, to describe the dependancies between application sources
> and how to build the applications.  Normally when you compile a C file
> you get an object file, not an executable program.  All the objects
> for the project, just the one in this case, then need to be linked
> with the appropriate set of libraries in order to create the program
> executable.  Again this is just a simple system library in the case of
> a "hello" application.
>

Emacs does provide an interface to this shell command, with compile.
(Info > Emacs > Building > Compilation) details it out. Here is an
excerpt.

#+BEGIN_QUOTE
   The default compilation command is ‘make -k’, which is usually
correct for programs compiled using the ‘make’ utility (the ‘-k’ flag
tells ‘make’ to continue compiling as much as possible after an error).
*Note Make: (make)Top.  If you have done ‘M-x compile’ before, the
command that you specified is automatically stored in the variable
‘compile-command’; this is used as the default the next time you type
‘M-x compile’.  A file can also specify a file-local value for
‘compile-command’ (*note File Variables::).
#+END_QUOTE

> Since I do not use the menus either, I do not know what the various choices are.  
> However, this sounds to me like a "Human Factors" ambiguity problem.  
>
I do not understand the "Human Factors" ambiguity problem. So I refrain
speaking here

> Either the default for "compile" should be to execute "gcc" rather
> than "make", or the menu command "compile" should be changed to
> something like "make app".
>
You may try ply around with this:

(global-set-key (kbd "C-c C-c C-c")
                (lambda ()
                  (compile (format "gcc -c -o %s %s"
				   (replace-regexp-in-string "\\.[^\\.]*$"
							     ".o"
							     (buffer-file-name))
				   (buffer-file-name)))))


-- 
(B.V. Raghav)
Ph.D. Student,
Design Programme, IIT Kanpur



  reply	other threads:[~2016-07-20  4:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-19 11:11 Compilation in C and ADA Edward Zacharek
2016-07-19 17:36 ` B.V. Raghav
2016-07-20  2:50   ` Francis Belliveau
2016-07-20  4:30     ` B.V. Raghav [this message]
2016-07-23 14:22       ` Francis Belliveau
2016-07-23 17:52         ` Dale Snell
     [not found]         ` <mailman.1937.1469296394.26859.help-gnu-emacs@gnu.org>
2016-07-23 20:08           ` Emanuel Berg
     [not found]       ` <mailman.1922.1469283823.26859.help-gnu-emacs@gnu.org>
2016-07-23 15:05         ` Emanuel Berg
2016-07-24  4:20           ` Francis Belliveau
     [not found]           ` <mailman.1955.1469334108.26859.help-gnu-emacs@gnu.org>
2016-07-24 12:48             ` Emanuel Berg
2016-07-23 16:23 ` Kendall Shaw
     [not found] <mailman.1680.1468936015.26859.help-gnu-emacs@gnu.org>
2016-07-20  3:43 ` Rusi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y44xors9.fsf@ram.bvr.dp.lan \
    --to=bvraghav@iitk.ac.in \
    --cc=f.belliveau@comcast.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.