cons-discuss
[Top][All Lists]
Advanced

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

Cons with output in Separate Subdirectories.


From: Marcello Pietrobon
Subject: Cons with output in Separate Subdirectories.
Date: Mon, 13 Nov 2000 08:53:54 -0600

Hi, cons team
I'm working under Windows 2000 and I'm trying to learn your beautiful
program cons.
(My ultimate goal is to do with cons the same that it is possible to do
using makefile in order
to compile and test the Blitz++ library under WIndows 2000)
But I'm having some problems (beside the fact that I'm not able to make
Digest-MD5-2.12 as I just wrote in an other email)

I'am not able to put the .obj files in Separate subdirectories.

This is the situation:
I need to compile the file hello.c in the current directory and
put in separate subdirectories (.\MSVCPP and .\INTEL) *both* the .obj
and the .exe files.

I'am using your example which I found in the Cons FAQ where is the
question:
6.9. How do I build multiple software versions from a single source?

I'am not able to do it using your example.
This is in short my Construct file (at the end the complete version of
it):
------------------------------------------------------------------
  # Trees
     $src = "#src";
     $build = "#build";

#     $variantMSVCPP = "$build\\MSVCPP";
#     $variantINTEL = "$build\\INTEL";
     $variantMSVCPP = "MSVCPP";
     $variantINTEL = "INTEL";

     Link $build => $src;

     $consMSVCPP = new cons(...);
     $consINTEL = new cons(...);

     # common sources
     @srcs = qw(hello.c);

     # Variant of Program `prog' for Microsoft Visual C++
  print $src, $variantMSVCPP, "\n";
#   Install $consMSVCPP $variantMSVCPP, map("$src\\$_", @srcs);
#   Program $consMSVCPP "$variantMSVCPP\\hello.exe", map("$_", @srcs);

     # Variant of Program `prog' for Intel
   print $src, $variantINTEL, "\n";
     Install $consINTEL $variantINTEL, map("$src/$_", @srcs);
     Program $consINTEL "$variantINTEL\\hello.exe", map("$_", @srcs);
---------------------------------------------------------------------------------------------

With the Intel compiler I execute
cons.pl INTEL\hello.exe

With the Microsoft Visual C++ compiler I comment the Install and Program

lines related to INTEL and I execute
cons.pl MSVCPP\hello.exe

In this way it works but
1)
the obj file goes in the current directory (not in the desired
subdirectory)

2)
I wish not to have to change every time the Costruct file commenting and
uncommenting
the lines with Install and Programs
If I do not do it I get the message:
cons.pl: error in file "Construct" (cons.pl: attempt to build hello.obj
twice, in different ways!)
cons.pl: script errors encountered: construction aborted

3)
The line Install... seems useless, if I comment it then I get the same
result, i.e is working in the same (unsatisfying for me) way.

4)
If instead than
    Program $consINTEL "$variantINTEL/prog", map("$_", @srcs);
I use , as in your example,
    Program $consINTEL "$variantINTEL/prog", map("$variantINTEL/$_",
@srcs);
then I get the message:
cons.pl: don't know how to construct "INTEL\hello.c"
because $variantINTEL looks having the value: "#build\\INTEL" (just in
case I tried with $variantINTEL = "$build/INTEL"; also).

5)
I'am not able to understand what do mean #src and #build :
     $src = "#src";
     $build = "#build";
I couldn't find the meaning in your documentation (but I don't know well
Perl at all, I'm learning it better because of your program)

6)
This question is just a wish for an answer:
I have many test file the same directory, and I would like to do the
same that I tried to do with the file hello.c, but with ALL the *.cpp
files in that directory.
Can you give me some hints to do that ?

7)
Other wish for an answer:
It is possible to run the programs just created using cons ?
This is order to do many different compilations and testing all
together.


Thank you very much in advance for all your answers.

Marcello

------------------------------------Construct
(full)--------------------------------------------
  # Trees
     $src = "#src";
     $build = "#build";

#this is the main correction
#     $variantMSVCPP = "$build\\MSVCPP";
#     $variantINTEL = "$build\\INTEL";
     $variantMSVCPP = "MSVCPP";
     $variantINTEL = "INTEL";

     Link $build => $src;


     # cons object for variantMSVCPP
     $consMSVCPP = new cons
     (
#         CFLAGS => '-DVARIANTMSVCPP',
          ENV => {
            PATH =>
"C:\\GNU\\Perl\\bin\\;C:\\WINNT\\system32;C:\\WINNT;C:\\WINNT\\system32\\WBEM;C:\\WINNT\\system32;C:\\WINNT;C:\\WINNT\\System32\\Wbem;C:\\PROGRA~1\\MICROS~3\\Common\\msdev98\\BIN;C:\\PROGRA~1\\MICROS~3\\VC98\\BIN;C:\\PROGRA~1\\MICROS~3\\Common\\TOOLS\\WINNT;C:\\PROGRA~1\\MICROS~3\\Common\\TOOLS",

            INCLUDE =>
"C:\\PROGRA~1\\MICROS~3\\VC98\\ATL\\INCLUDE;C:\\PROGRA~1\\MICROS~3\\VC98\\INCLUDE;C:\\PROGRA~1\\MICROS~3\\VC98\\MFC\\INCLUDE",

            LIB =>
"C:\\PROGRA~1\\MICROS~3\\VC98\\LIB;C:\\PROGRA~1\\MICROS~3\\VC98\\MFC\\LIB;",

            PATHEXT => $ENV{PATHEXT},
            USER => $ENV{USER},
          },
          CC => 'cl',
    );


   # cons object for variantINTEL
   $consINTEL = new cons
   (
#         CFLAGS => '-DVARIANTINTEL',
        ENV => {
     PATH =>
"C:\\GNU\\Perl\\bin\\;C:\\WINNT\\system32;C:\\WINNT;C:\\WINNT\\system32\\WBEM;C:\\WINNT\\system32;C:\\WINNT;C:\\WINNT\\System32\\Wbem;C:\\Program
Files\\Intel\\edb32\\;C:\\Program
Files\\Intel\\compiler45\\bin;C:\\PROGRA~1\\MICROS~3\\Common\\msdev98\\BIN;C:\\PROGRA~1\\MICROS~3\\VC98\\BIN;C:\\PROGRA~1\\MICROS~3\\Common\\TOOLS\\WINNT;C:\\PROGRA~1\\MICROS~3\\Common\\TOOLS",

     INCLUDE => "C:\\Program
Files\\Intel\\compiler45\\include;C:\\PROGRA~1\\MICROS~3\\VC98\\ATL\\INCLUDE;C:\\PROGRA~1\\MICROS~3\\VC98\\INCLUDE;C:\\PROGRA~1\\MICROS~3\\VC98\\MFC\\INCLUDE",

     LIB => "C:\\Program
Files\\Intel\\compiler45\\lib;C:\\PROGRA~1\\MICROS~3\\VC98\\LIB;C:\\PROGRA~1\\MICROS~3\\VC98\\MFC\\LIB;",

     PATHEXT => $ENV{PATHEXT},
     USER => $ENV{USER},
        },
        CC => 'icl',
  );


     # common sources
#     @srcs = qw(a.c b.c c.c);
     @srcs = qw(hello.c);

     # variantMSVCPP sources
#     @varMSVCPPsrc = qw(hello.c);

     # variantINTEL sources
#     @varINTELsrc = qw(d.c);


     # Variant of Program `prog' for Microsoft Visual C++

##     Install $consMSVCPP $variantMSVCPP, map("$src\\$_", @srcs,
@varMSVCPPsrc);
##     Program $consMSVCPP "$variantMSVCPP/prog",
map("$variantMSVCPP/$_", @srcs, @varMSVCPPsrc);
  print $src, $variantMSVCPP, "\n";
     #Program $consMSVCPP "$variantMSVCPP\\hello.exe",
map("$variantMSVCPP\\$_", @srcs);
     #    cons.pl: don't know how to construct "MSVCPP\hello.c"
#   Install $consMSVCPP $variantMSVCPP, map("$src\\$_", @srcs);
#   Program $consMSVCPP "$variantMSVCPP\\hello.exe", map("$_", @srcs);
#OK


     # Variant of Program `prog' for Intel

##     Install $consINTEL $variantINTEL, map("$src\\$_", @srcs,
@varINTELsrc);
##     Program $consINTEL "$variantINTEL/prog", map("$variantINTEL/$_",
@srcs, @varINTELsrc);
 print $src, $variantINTEL, "\n";
  #     Program $consINTEL "$variantINTEL/hello", map("$_", @srcs,
@varINTELsrc);
     Install $consINTEL $variantINTEL, map("$src/$_", @srcs);
     Program $consINTEL "$variantINTEL\\hello.exe", map("$_", @srcs);

-------------------------------------------------------------------------------------







reply via email to

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