Re: [Vala] Does anyone know how to use parvala?



Thanks for your response, but my goal is to be able to create a good,
general-purpose Makefile for building Vala projects. Autotools work well for
porting to as many platforms as possible, but for simply building and
testing it's overkill. My first attempt lacked parallel build support and
would re-compile the entire source tree every time, which I hoped parvala
would solve, but I discovered that it has a couple large shortcomings for
how I want to use it:

   - Doesn't support subdirectories. If I try running a command like parvala
   -C src/hello.vala, I get the error message "*make: *** No rule to make
   target `.vala-aux/hello.dep', needed by `all'.  Stop*." On the other
   hand, if I cd into src/ and then run parvala -C hello.vala, it works.
   - Places compiled .c files in the same folder. In a Vala project, .c
   files are an intermediate step to the final compiled result and not part of
   the source, so they shouldn't be treated as such.

Because of these, I started working on a new Makefile using parvala.mk as a
template. Like I mentioned before, the idea is to have this Makefile be a
drop-in tool to start building Vala projects, and not require additional
scripts or configuration. Here's a basic run-through:

   - All vala files under src/ are located
   - .vala-aux/ and all necessary .dep, .vapi, and .stamp files are
   generated a la parvala; this primarily ensures that only modified source
   files are compiled
   - Compile all modified vala files to C in build/c/
   - Compile all modified C files in /build/c/ to object files in build/o/
   - Compile all modified object files in /build/o/ to generate the final
   executable in build/

The exact structure is easily configurable, but the idea is to have one
directory for the source and another directory for all compiled results,
which include .c, .o, and executable files. Cleaning the project for a fresh
build is as easy as removing build/ and .vala-aux/.

If there is some interest in it, I can polish it up and submit it to contrib
for users who would prefer plain make over automake for their projects.

On Tue, Aug 23, 2011 at 10:11 AM, Abderrahim Kitouni <a kitouni gmail com>wrote:

في ن، 22-08-2011 عند 17:13 -0700 ، كتب Damien Radtke:
It's linked to at the bottom of this
page<https://live.gnome.org/Vala/Documentation/ParallelBuilds>,
but its documentation is non-existent. Any tips on how to use it in a
project?

The same way you would use valac: if you copy it in your path and copy
parvala.mk so it can find it (it looks in ../share/parvala/ relative to
where the parvala script is located), you can build with something like
make -s VALAC=parvala (assuming automake) or make your configure script
look for parvala before valac.

HTH,
Abderrahim




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]