cons-discuss
[Top][All Lists]
Advanced

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

problem with basic cons script


From: Richard Eperjesi
Subject: problem with basic cons script
Date: Thu, 14 Feb 2002 09:38:03 -0600

Nadim,


Could you please send me the most basic Construct scrupt that should compile
and build hello.c using MS compiler and linker?

Here is what I have and the output below.


$env = new cons(
        ENV     =>   {%ENV},
        CC      =>      'cl',
  );

Program $env 'hello', 'hello.c';


Output:
C:\temp\test>cons hello
cons.bat: don't know how to construct "hello"

C:\temp\test>


I do have a hello.c in my c:\temp\test directory.



Thanks,
Richard


PS: Could you send me the 7.2MB pdf to address@hidden







> I am a C++ guy, do not know much about perl and it's stated on the CONS
> page that perl knowledge is not required

Right, you can think about cons as a utility wich you don't need to extend
then you do not need to know perl.

> My first problem is that I cannot run the cons-test script succesfully. If
> I pass a non-existent test script it says ran successfully, if I run it on
> an existing one, it fails, complaining about not having any directory

OK, let's try to compile something.It seems that just have configuration
problems.

1/ what compiler do you use?
2/ what environment variables are needed ?

> C:\cons-2.2.0\test>perl cons-test -d t -x C:\cons-2.2.0\cons -I


Wow, wow easy here. Let's start with a simple example. No command line
switches. Something very simple we can build on

> /* Construct script - BEGIN */
> # -*- Perl -*-
>
> Import qw(CONS INCLUDE LIB BIN PYTHON SWIG TABLES BUILD BUILDTYPE EXPORT
> DEFINES RULES);
>
> $env = new cons(
>         CC      =>      'ccppc',
>         LIBS    =>      'libworld.a'
>   );
>
> Program $env 'hello', 'hello.c';
> /* Construct script - END */

1/ I am not any guru (just started using cons) but I think the first line is
completely wrong. You can't import things that have not been exported.
Import is used in sub cons files (called conscripts as opposed to top level
Construct file)

2/ No environment is defined in you construct file.
You need "ENV       => {%ENV}" in you $env contructor.


> Also, can you tell me what the magic qw does? I see it everywhere in
> scripts
Sure, it builds a list of strings, the element of the list are separated
with spaces. Ex: qw(a b c d) is equivalent to ("a", "b", "c", "d")


> Thanks for your help. CONS looks interesting, would be nice to have
> something that can compete with make and platform and IDE independent.

Cons is VERY interesting, very powerful and fun to work with when you get it
to work. I have a working example with repositories and separate build
directories. Let's work our way to that kind of complex system but let's
start by compiling something.

The archive I have is +/- 1 month old and it is 7.2 MB in size. Can you get
such big mails?

Nadim.


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]