Command-line code generation with PhAB

Hi,

I’m using PhAB v1.12 and I would like to know if there is a way to generate
the ab* files for a given application (abapp.dfn file) from the command line
(so that it can be incorporated in a Makefile or script). I wish to
automate the manual process of opening PhAB, loading the application, and
selecting Application, Build + Run, Generate.

Thanks
Eric

Eric Soulard <eric.soulard@transport.bombardier.com> wrote:
: Hi,

: I’m using PhAB v1.12 and I would like to know if there is a way to generate
: the ab* files for a given application (abapp.dfn file) from the command line
: (so that it can be incorporated in a Makefile or script). I wish to
: automate the manual process of opening PhAB, loading the application, and
: selecting Application, Build + Run, Generate.

Nope. In fact this has been explicitly asked for and we didn’t have
enough weight with QSSL to have the resources dedicated to add that
functionality. Perhaps Bombardier has more weight. :slight_smile:

Rick…


Rick Duff Internet: rick@astra.mb.ca
Astra Network QUICS: rgduff
QNX Consulting and Custom Programming URL: http://www.astra.mb.ca
+1 (204) 987-7475 Fax: +1 (204) 987-7479

Eric Soulard <eric.soulard@transport.bombardier.com> wrote:

I’m using PhAB v1.12 and I would like to know if there is a way to generate
the ab* files for a given application (abapp.dfn file) from the command line
(so that it can be incorporated in a Makefile or script). I wish to
automate the manual process of opening PhAB, loading the application, and
selecting Application, Build + Run, Generate.

There’s no such program. But there is an easy way to avoid needing it:
whenever you modify your application, make sure that you re-generate
before exiting from PhAB. :slight_smile:

One thing we could do to help you, much easier than separating the code
that loads and generates an app from the rest of PhAB, is we could give
you a tiny program that looks at your abapp.dfn and signals failure if
the code needs to be re-generated. You could run it from your Makefile
to make sure that you’re not trying to build the application after
someone has modified it and forgotten to re-generate.

Would that solve your problem?

\

Wojtek Lerch (wojtek@qnx.com) QNX Software Systems Ltd.

That tiny program would be much appreciated. Even if it does not allow me to
automate the entire process, I could at least use it to make sure that files
under CM are consistent with each other.

Thank you very much!


Wojtek Lerch <wojtek@qnx.com> wrote in message
news:8tq06m$er3$1@nntp.qnx.com

Eric Soulard <> eric.soulard@transport.bombardier.com> > wrote:
I’m using PhAB v1.12 and I would like to know if there is a way to
generate
the ab* files for a given application (abapp.dfn file) from the command
line
(so that it can be incorporated in a Makefile or script). I wish to
automate the manual process of opening PhAB, loading the application,
and
selecting Application, Build + Run, Generate.

There’s no such program. But there is an easy way to avoid needing it:
whenever you modify your application, make sure that you re-generate
before exiting from PhAB. > :slight_smile:

One thing we could do to help you, much easier than separating the code
that loads and generates an app from the rest of PhAB, is we could give
you a tiny program that looks at your abapp.dfn and signals failure if
the code needs to be re-generated. You could run it from your Makefile
to make sure that you’re not trying to build the application after
someone has modified it and forgotten to re-generate.

Would that solve your problem?

\

Wojtek Lerch (> wojtek@qnx.com> ) QNX Software Systems Ltd.

Eric Soulard <eric.soulard@transport.bombardier.com> wrote:

That tiny program would be much appreciated. Even if it does not allow me to
automate the entire process, I could at least use it to make sure that files
under CM are consistent with each other.

I’ll just give you the source code. Note that this won’t work with
Photon 2, but I’ll make sure that a similar program is added to Photon 2.


#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

static int checkfile( const char *fn ) {
int fd, n;
enum { N = 5 };
char buf[ N ];
if ( ( fd = open( fn, O_RDONLY ) ) < 0
|| lseek( fd, 134, SEEK_SET ) < 0
|| ( n = read( fd, buf, N ) ) < 0
)
perror( fn );
else {
close( fd );
if ( n != N )
fprintf( stderr, “%s: not a PhAB file\n”, fn );
else {
static const char zeros[ N ];
if ( ! memcmp( buf, zeros, N ) )
return 0;
else {
fprintf( stderr, “%s: needs to be re-generated\n”, fn );
return 1;
} } }
return 2;
}

int main( int argc, char **argv ) {
int result;
char *fn;
if ( ( fn = *++argv ) == NULL )
result = checkfile( “abapp.dfn” );
else
while ( ( result = checkfile( fn ) ) == 0
&& ( fn = *++argv ) != NULL
);
return result;
}


Wojtek Lerch <> wojtek@qnx.com> > wrote in message
news:8tq06m$er3$> 1@nntp.qnx.com> …
Eric Soulard <> eric.soulard@transport.bombardier.com> > wrote:
I’m using PhAB v1.12 and I would like to know if there is a way to
generate
the ab* files for a given application (abapp.dfn file) from the command
line
(so that it can be incorporated in a Makefile or script). I wish to
automate the manual process of opening PhAB, loading the application,
and
selecting Application, Build + Run, Generate.

There’s no such program. But there is an easy way to avoid needing it:
whenever you modify your application, make sure that you re-generate
before exiting from PhAB. > :slight_smile:

One thing we could do to help you, much easier than separating the code
that loads and generates an app from the rest of PhAB, is we could give
you a tiny program that looks at your abapp.dfn and signals failure if
the code needs to be re-generated. You could run it from your Makefile
to make sure that you’re not trying to build the application after
someone has modified it and forgotten to re-generate.

Would that solve your problem?

Wojtek Lerch (wojtek@qnx.com) QNX Software Systems Ltd.