For Programmers: Free Programming Magazines  


Home > Archive > Cobol > April 2007 > powercobol compile all directory projects









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author powercobol compile all directory projects
ramzenit

2007-04-09, 6:55 pm

Hello,
I need compile all powercobol program into my programs directory.
How to compile all program with a bat command ?
Thanks
RamZenit

Jeff Campbell

2007-04-09, 6:55 pm

ramzenit wrote:
> Hello,
> I need compile all powercobol program into my programs directory.
> How to compile all program with a bat command ?
> Thanks
> RamZenit
>


There is a "Rebuild All" button on the tool bar. It will re-compile
all of the source files in the project's (program's) directory.

I don't know how to structure a .BAT command file to do this.

Jeff

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
ramzenit

2007-04-10, 7:55 am

Thanks Jeff,
but my problem is different, I would like to compile all the ppj in
the directory without calling them one to one back.


Jeff Campbell ha scritto:

> ramzenit wrote:
>
> There is a "Rebuild All" button on the tool bar. It will re-compile
> all of the source files in the project's (program's) directory.
>
> I don't know how to structure a .BAT command file to do this.
>
> Jeff
>
> ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
> http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
> ----= East and West-Coast Server Farms - Total Privacy via Encryption =----


donald tees

2007-04-10, 7:55 am

ramzenit wrote:
> Thanks Jeff,
> but my problem is different, I would like to compile all the ppj in
> the directory without calling them one to one back.
>
>
> Jeff Campbell ha scritto:
>
>


A batch file is pretty simple if you have projects set up. Each program
in the project will have a corresponding make file. Simply use nmake on
each. You will also need to check for errors after each.

Donald


Michael Mattias

2007-04-10, 7:55 am

> I need compile all powercobol program into my programs directory.
> How to compile all program with a bat command ?


The batch command will be something like..

FOR %F IN (*.cbl) DO compilername.exe %F options

Get exact syntax by looking up help for CMD files; from a command prompt
type "help for"

Still unsure? try one of the newsgroups which are dedicated to batch/command
files. Some of those guys are incredibly imaginative.


--
Michael C. Mattias
Tal Systems Inc.
Racine WI
mmattias@talsystems.com


donald tees

2007-04-10, 6:55 pm

ramzenit wrote:
> Thanks Jeff,
> but my problem is different, I would like to compile all the ppj in
> the directory without calling them one to one back.


Further to my previous post ... the following batch program compiles a
number of PRJ files.
M:
CD\LIBRARY\PROJECTS
NMAKE SCREENH.MAK
if errorlevel 1 goto done
NMAKE SETUPD.MAK
if errorlevel 1 goto done
NMAKE PRINTERT.MAK
if errorlevel 1 goto done
NMAKE TICKFILE.MAK
if errorlevel 1 goto done
NMAKE TICKREPS.MAK
if errorlevel 1 goto done
NMAKE TICKHIGH.MAK
if errorlevel 1 goto done
NMAKE TICKMAIN.MAK
if errorlevel 1 goto done
NMAKE TICKEXES.MAK
if errorlevel 1 goto done
CD\LIBRARY\MISC
CALL SETUP
CD\LIBRARY\PROJECTS
goto exit
:done
PAUSE ERROR
:exit

SCREENH, SETUPD, etc. are each PRJ files. If any has an error, it hits
the pause at the end, else it completes.

Donald
Pete Dashwood

2007-04-10, 6:55 pm


"donald tees" <donald@execulink.com> wrote in message
news:GrednVznCOlyEYbbnZ2dnUVZ_q-vnZ2d@golden.net...
> ramzenit wrote:
>
> Further to my previous post ... the following batch program compiles a
> number of PRJ files.
> M:
> CD\LIBRARY\PROJECTS
> NMAKE SCREENH.MAK
> if errorlevel 1 goto done
> NMAKE SETUPD.MAK
> if errorlevel 1 goto done
> NMAKE PRINTERT.MAK
> if errorlevel 1 goto done
> NMAKE TICKFILE.MAK
> if errorlevel 1 goto done
> NMAKE TICKREPS.MAK
> if errorlevel 1 goto done
> NMAKE TICKHIGH.MAK
> if errorlevel 1 goto done
> NMAKE TICKMAIN.MAK
> if errorlevel 1 goto done
> NMAKE TICKEXES.MAK
> if errorlevel 1 goto done
> CD\LIBRARY\MISC
> CALL SETUP
> CD\LIBRARY\PROJECTS
> goto exit
> :done
> PAUSE ERROR
> :exit
>
> SCREENH, SETUPD, etc. are each PRJ files. If any has an error, it hits the
> pause at the end, else it completes.
>
> Donald


Using NMAKE is a pretty idea, Donald.

Will it accept wildcard operands... ?
NMAKE *.MAK > LPT1:

....could be useful. Instead of a pause when a build screws up, check the
listing and see if they all completed successfully...

Unfortunately the machine I'm writing this on doesn't have NMAKE on it, and
the COBOL machine is powered down and in a different location, so I can't
check it.

Pete.


donald tees

2007-04-10, 6:55 pm

Pete Dashwood wrote:
>
> Using NMAKE is a pretty idea, Donald.
>
> Will it accept wildcard operands... ?
> NMAKE *.MAK > LPT1:
>
> ...could be useful. Instead of a pause when a build screws up, check the
> listing and see if they all completed successfully...
>
> Unfortunately the machine I'm writing this on doesn't have NMAKE on it, and
> the COBOL machine is powered down and in a different location, so I can't
> check it.
>
> Pete.
>
>

NMAKE is used by Fujitsu Cobol, and the MAK files are created by the
project manager. I notice that when I run it, it says copyright by MS.
I do not know if it was installed at window installation, or as part
of the Fujitsu install. Regardless, the standard Cobol "IDE"(Pstaff)
from Fujitsu use it to do the build when you hit the Compile button.
All it really does is put the output into a window.

I do not like Pstaff much, and usually end up with six or seven
different pstaff projects within a real project. The batch program is a
way of doing a complete project build, and makes it a lot faster to
test. Generally, I run my install program as the last step of the batch
program.

If you put the output into different areas by using a CBI file, then a
forced full rebuild can be done by simply erasing the area. I removed
the CD \LIBRARY\OBJECT, ERASE *.* in the sample batch program for
clarity. Since that asks for confirmation, the choice happens when you
run it. The CBI files for the projects in the shown batch file all look
like:

[Compile Options]
COPY=Yes
OBJECT=Yes \LIBRARY\OBJECT
PRINT=Yes \LIBRARY\LISTINGS
REP=\library\OBJECT
SOURCE=Yes
TRUNC=No


Donald

donald tees

2007-04-10, 6:55 pm

Pete Dashwood wrote:
> Will it accept wildcard operands... ?
> NMAKE *.MAK > LPT1:
>

Do not know, as I have never tried it. However, I can see two problem
doing it the way you suggest.

First of all, the entire point of the batch file is to do things in a
specific order. The first project creates rep files and object libraries
required for the second, etc. That is the main problem with Pstaff.
The damed thing sorts into alphabetical order, and there is no way to
force a specific order except doing it manually, one DLL at a time.
The approach is fubar for OOP stuff, as inheritance levels etc. are
completely discarded. Thus I split the main project up into
sub-projects, and compile them in order.

Secondly, I do that when I am testing ... if the compile finishes, I
proceed to the install step, and sometimes even end the batch file with
a CD to the run area and execution.

NMAKE *.mak may work for a small collection of independent programs,
though. I'll try it later.

Donald


HeyBub

2007-04-10, 6:55 pm

ramzenit wrote:
> Hello,
> I need compile all powercobol program into my programs directory.
> How to compile all program with a bat command ?
> Thanks
> RamZenit


How about :

PowerCOB {/build | /rebuild} [/Debug | /Release]
[/cbi: "OPTION-FILE-NAME"]
"PROJECT-FILE-NAME"

with the results being placed in the "(projectname).blg" file.

Example:

powercob /build "C:\myprojects\proj1.ppj"

The PCV6 documentation even has a sample bat file to rebuild a whole passle
of programs while concatenating the results files into one big file for
review.

I might even modify the supplied bat file using the FOR command to suck up
everything in the folder.

I did. Here's my batch file, COMPILE.BAT

C:
CD \C-SOURCE
ECHO BEGIN > RESULT.TXT
FOR %%A IN (*.PPJ) DO POWERCOB /Rebuild /Release %%A
FOR %%A IN (*.BLG) DO TYPE %%A >> RESULT.TXT
FOR %%A IN (*.BLG) DO DEL %%A
TYPE RESULT.TXT

You might want to gussy it up some, but it's a start.


HeyBub

2007-04-11, 6:55 pm

HeyBub wrote:
> ramzenit wrote:
>
> How about :
>
> PowerCOB {/build | /rebuild} [/Debug | /Release]
> [/cbi: "OPTION-FILE-NAME"]
> "PROJECT-FILE-NAME"
>
> with the results being placed in the "(projectname).blg" file.
>
> Example:
>
> powercob /build "C:\myprojects\proj1.ppj"
>
> The PCV6 documentation even has a sample bat file to rebuild a whole
> passle of programs while concatenating the results files into one big
> file for review.
>
> I might even modify the supplied bat file using the FOR command to
> suck up everything in the folder.
>
> I did. Here's my batch file, COMPILE.BAT
>
> C:
> CD \C-SOURCE
> ECHO BEGIN > RESULT.TXT
> FOR %%A IN (*.PPJ) DO POWERCOB /Rebuild /Release %%A
> FOR %%A IN (*.BLG) DO TYPE %%A >> RESULT.TXT
> FOR %%A IN (*.BLG) DO DEL %%A
> TYPE RESULT.TXT
>
> You might want to gussy it up some, but it's a start.


So, I gussied it up:

(COMPILE.BAT)

@ECHO OFF
C:
CD \C-SOURCE
IF EXIST == RESULT.TXT DEL RESULT.TXT
IF EXIST == *.BLG DEL *.BLG
ECHO BEGIN COMPILATION BATCH > RESULT.TXT
FOR %%A IN (*.PPJ) DO call compile2.bat %%A
TYPE RESULT.TXT

(COMPILE2.BAT)

@ECHO OFF
ECHO Compile %1
echo === BEGIN %1 >> RESULT.TXT
POWERCOB /REBUILD %1
IF ERRORLEVEL 1 GOTO FAIL
GOTO OK

:FAIL
ECHO . >> RESULT.TXT
ECHO !!! E R R O R I N %1 !!! >> RESULT.TXT
ECHO . >> RESULT.TXT

:OK
TYPE *.BLG >> RESULT.TXT
DEL *.BLG /Q
echo === END %1 >> result.txt
ECHO =============================== >> RESULT.TXT
ECHO =============================== >> RESULT.TXT
ECHO . >> RESULT.TXT
ECHO . >> RESULT.TXT


Pete Dashwood

2007-04-11, 6:55 pm


"HeyBub" <heybubNOSPAM@gmail.com> wrote in message
news:131q493n5m1v578@news.supernews.com...
> HeyBub wrote:
>
> So, I gussied it up:
>
> (COMPILE.BAT)
>
> @ECHO OFF
> C:
> CD \C-SOURCE
> IF EXIST == RESULT.TXT DEL RESULT.TXT
> IF EXIST == *.BLG DEL *.BLG
> ECHO BEGIN COMPILATION BATCH > RESULT.TXT
> FOR %%A IN (*.PPJ) DO call compile2.bat %%A
> TYPE RESULT.TXT
>
> (COMPILE2.BAT)
>
> @ECHO OFF
> ECHO Compile %1
> echo === BEGIN %1 >> RESULT.TXT
> POWERCOB /REBUILD %1
> IF ERRORLEVEL 1 GOTO FAIL
> GOTO OK
>
> :FAIL
> ECHO . >> RESULT.TXT
> ECHO !!! E R R O R I N %1 !!! >> RESULT.TXT
> ECHO . >> RESULT.TXT
>
> :OK
> TYPE *.BLG >> RESULT.TXT
> DEL *.BLG /Q
> echo === END %1 >> result.txt
> ECHO =============================== >> RESULT.TXT
> ECHO =============================== >> RESULT.TXT
> ECHO . >> RESULT.TXT
> ECHO . >> RESULT.TXT
>
>

Cool! (in a 1980s kind of way...:-))

These days it should be a WSH script, but, Hey, if it works...and it
obviously does. I hope the OP takes the trouble to acknowledge your efforts,
Jerry.

Pete.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com