Compile-Run Cycle

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Compile-Run Cycle

Anarchean
Hello,

  I'm new to autotools and currently I'm using C++ with autotools
and vim. I was wondering how you usually run the programs.
My current workflow is the following:

My folder structure:

| project_home
| - configure.ac
| - Makefile.am
| - configure
| - build/
| - sandbox/
| - src/
  | - Makefile.am
  | - source1.c++
  | - source2.c++

  I use two terminals, one is running vim from inside the
src dir. The other one has a variable PREFIX=$project_root/sandbox,
and I use it to compile and run the program, which is usually the
follow command sequence:

Once in a while:
% ./configure --prefix="$PREFIX"

And then every modification:
% make
% make install
% "$PREFIX/bin/project_name"

  Is there any way to automate this? How people usually do it?


_______________________________________________
Autoconf mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/autoconf
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Compile-Run Cycle

Gavin Smith
On 28 December 2016 at 03:30, Anarchean <[hidden email]> wrote:
> Once in a while:
> % ./configure --prefix="$PREFIX"

I only configure when I need to, for example when the configure script
has changed.

> And then every modification:
> % make
> % make install
> % "$PREFIX/bin/project_name"

I run from the build directory most of the time, without installing, e.g.

% make
% ./project_name

_______________________________________________
Autoconf mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/autoconf
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Compile-Run Cycle

Eric Blake-3
In reply to this post by Anarchean
On 12/27/2016 09:30 PM, Anarchean wrote:

>
>   I use two terminals, one is running vim from inside the
> src dir. The other one has a variable PREFIX=$project_root/sandbox,
> and I use it to compile and run the program, which is usually the
> follow command sequence:
>
> Once in a while:
> % ./configure --prefix="$PREFIX"
>
> And then every modification:
> % make
> % make install
> % "$PREFIX/bin/project_name"
>
>   Is there any way to automate this? How people usually do it?
That works. Another thing to try is to get your software to the point
that it will run when uninstalled, from a VPATH build tree.  Then you
can shorten the steps to

% make
% ./src/project_name

assuming that the 'make install' step is what copies src/project_name to
$PREFIX/bin/project_name.  If you have a good testsuite, and have
properly hooked it into automake, then 'make check' is a good way to
test the uninstalled project.

--
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


_______________________________________________
Autoconf mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/autoconf

signature.asc (617 bytes) Download Attachment
Loading...