NO

Author Topic: Trying to re-build project file at Command Line with Pomake.exe  (Read 7310 times)

EdPellesC99

  • Guest
  I am having trouble setting up my environmental variables in system.

  If I open a console window in my .ppj file Folder, and run povars32.bat, then in the same console give a command line like:

"C:\Program Files\PellesC\Bin\pomake.exe" -f "Determine String Lenght.ppj"

  Then the project does re-build.
  Wanting to re-build without running povars32.bat, I need to make permanent changes to the system environmental variable.

  However after making sure that every folder referred to in povars32.bat, has been placed in my system path environmental variable..... and have re-booted, and verified all is there by opening a console window and typing the Path command..........

issuing at the Command line: "C:\Program Files\PellesC\Bin\pomake.exe" -f "Determine String Lenght.ppj" again ......
will give me a 1035 error, that it cannot find the <windows.h> file.

  I have set up other language compilers by editing the Path variable so that changes are permanent.

  I do not understand why I am having no luck here.

  Any ideas or recommendations ? or ??????

  Thanks, Ed

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: Trying to re-build project file at Command Line with Pomake.exe
« Reply #1 on: April 28, 2010, 10:54:45 AM »
Why don't you do just a shortcut to povars32.bat and open command prompt from it.
I prefer that.

Shortcut properties:
Target: %comspec% /k "C:\Program Files\PellesC6\Bin\povars32.bat"
Working folder empty.

In povars32.bat you can also chance path shorter.
set PATH=%PellesCDir%\Bin;%SystemRoot%\system32
May the source be with you

EdPellesC99

  • Guest
Re: Trying to re-build project file at Command Line with Pomake.exe
« Reply #2 on: April 28, 2010, 06:04:04 PM »
   Timo,

   Thanks for the response. I have another editor I like for other work (Edit Pad Pro paired with Ace Text together).
   I have it set up so I can click on a tool button and compile a file in the editor window. It uses macros to place the filename in.

   In my epp project I might have many different file types, .c files, and .cmd, or .vbs, or .hta files, .js, .html  etc.
I can click a tool bar button, and run or compile the file that I have open in the editor window. I can develop custom color syntax schemes for different filetypes etc., I have few complaints, having spent a couple years customizing it.

  On using pomake.exe:
I might want to make a small change in my .c file then rebuild the .ppj file with pomake.exe quickly at the click of a button, while the
.c file associated with the .ppf file is loaded in the EPP editor window (otherwise for poide.exe I would have to open a folder,
double click the .ppf file, opening in Pelles C, then choosing rebuild.

  So for e.g.:
EPP is open with my .c file in the editor window, a macro in EPP like:
"%FILENAMENOEXT%.ppj" will give me the project name from the .c filename,

As a "Tool" that I assign to a new toolbar button (a command for the command line):

C:\WINDOWS\system32\cmd.exe /k pomake.exe -f "%FILENAMENOEXT%.ppj"

Ok, but if I run this I get the 1035 error you see below.

But if my "Tool" is:
C:\WINDOWS\system32\cmd.exe /k povars32.bat && pomake.exe -f "%FILENAMENOEXT%.ppj"

voila, the project is re-built by pomake.exe !

   Yes this workaround works.
But I want to understand what I do not get about System variables that is goofing me up !!!!!!

'' ~ •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •
'' ~ •  •  •  •  •  •  •  •  •   OK For Troubleshooting all below has nothing to do with the EPP editor.

Open a console window (in the folder of my .ppj and my .c file),

Prompt: and my command followed by Output:
C:\SGV1\C SafeString\Console\StringCchLenght>Set Path

Output:
Path=etc etc then at the end of the variable I have:
C:\Program Files\Log Parser 2.2\;C:\Program Files\get_iplayer\;C:\Program Files\Gentee\exe\;
C:\Program Files\PellesC;C:\Program Files\PellesC\Bin;C:\Program Files\Include;
C:\Program Files\PellesC\Include\Win;C:\Program Files\PellesC\Lib;C:\Program Files\PellesC\Lib\Win


I really do not think I needed to add (to the Path variable), my Include Paths and lib paths as I made new INCLUDE and LIB variables,
but I did because it was failure before adding them.

Then to check my System INCLUDE ....
Prompt: and my command followed by Output:
C:\SGV1\C SafeString\Console\StringCchLenght>Set INCLUDE

Output:

INCLUDE=C:\Program Files\PellesC\Include;C:\Program Files\PellesC\Include\Win

Then to check my System LIB ....
Prompt: and my command followed by Output:
C:\SGV1\C SafeString\Console\StringCchLenght>Set LIB

Output:

LIB=C:\Program Files\PellesC\Lib;C:\Program Files\PellesC\Lib\Win

Ok, Does All this look fine to you, because it sure does to me !!!
===========================================================================

Keeping Console Open issue following command at prompt:

"C:\Program Files\PellesC\Bin\pomake.exe" -f "Determine String Lenght uses TCHAR hr integer on return GOLD.ppj"

Output:

C:\SGV1\C SafeString\Console\StringCchLenght>"C:\Program Files\PellesC\Bin\pomake.exe" -f "Determine String Lenght uses TCHAR hr integer on return GOLD.ppj"
Determine String Lenght uses TCHAR hr integer on return GOLD.c(1): fatal error #1035: Can't find include file <windows.h>.
POMAKE: fatal error: 'pocc.exe', error 1.

=========================================================================

Keeping Console Open issue following command at prompt:

povars32.bat && "C:\Program Files\PellesC\Bin\pomake.exe" -f "Determine String Lenght uses TCHAR hr integer on return GOLD.ppj"

And voila, project builds.

Is it possible that pomake.exe can distinguish between temporary session environmental variables and System (permanent) variables. ....... That pomake.exe looks and reads in temporary variables only?????

I have never seen anything like this (assuming I am not blind to something here).
Thanks,
             •••• Ed

sapero

  • Guest
Re: Trying to re-build project file at Command Line with Pomake.exe
« Reply #3 on: April 28, 2010, 09:58:45 PM »
Use CALL povars32.bat, instead just povars32.bat.
If you wish to compile the project from the other IDE, set the command to
Code: [Select]
C:\WINDOWS\system32\cmd.exe /c call "C:\Program Files\PellesC\Bin\povars32.bat" && pomake.exe -f "%FILENAMENOEXT%.ppj"

// should work from hand
« Last Edit: April 28, 2010, 10:01:14 PM by sapero »

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: Trying to re-build project file at Command Line with Pomake.exe
« Reply #4 on: April 28, 2010, 11:10:28 PM »
If you make own batch-file for it like pomake.bat:
Code: [Select]
@echo off
rem pomake.bat
SET PellesCDir=C:\Program Files\PellesC
C:\Program Files\PellesC\bin\pomake.exe -f %1
pause
Does it work then ?

pomake.exe use  PellesCDir enviroment variable for that $(PellesCDir)

INCLUDE = $(PellesCDir)\Include\Win;$(PellesCDir)\Include#
LIB = $(PellesCDir)\Lib\Win;$(PellesCDir)\Lib#

If that work insert that enviroment variable to your system
May the source be with you

EdPellesC99

  • Guest
Re: Trying to re-build project file at Command Line with Pomake.exe
« Reply #5 on: April 29, 2010, 06:52:19 AM »
Quote
Use CALL povars32.bat, instead just povars32.bat.
If you wish to compile the project from the other IDE, set the command to
Code:
C:\WINDOWS\system32\cmd.exe /c call "C:\Program Files\PellesC\Bin\povars32.bat" && pomake.exe -f "%FILENAMENOEXT%.ppj"
// should work from hand

Sapero,
  Yes this would also work. But I am trying to make permanent (System) [Start/Control Panel/Performance and Maintenence/System/Advanced tab/Environmental Variables....... Then modify System Variables.

....... and of course you always have to re-boot for your changes to take place. You verify what your current system variables are by issuing command at the command prompt: Set Path, or Set Include etc. (and you can prove to yourself that changes you made have not taken effect yet (re-boot, and re-check and you see they have then taken effect).



   Timo:
Quote
If you make own batch-file for it like pomake.bat:

Code:
@echo off
rem pomake.bat
SET PellesCDir=C:\Program Files\PellesC
C:\Program Files\PellesC\bin\pomake.exe -f %1
pause
Does it work then ?
==========================
Ok, you want me to take the above .bat file, place it in the same folder as my .ppj file.
Open a console window in that directory, and issue this command:
(using my .ppj file as the argument).

Pomake.bat "Determine String Lenght uses TCHAR hr integer on return GOLD.ppj"

(I have not run povars32.bat)
   No Timo, this does not work.
To Double check, I re-wrote your batch file:

@echo off
rem pomake.bat
SET PellesCDir=C:\Program Files\PellesC
"C:\Program Files\PellesC\bin\pomake.exe" -f "Determine String Lenght uses TCHAR hr integer on return GOLD.ppj"
pause

and ran the above, but it did not work.


Now Timo, you have this (below), but I am aftaid I do not know what you want me to try !
Quote
pomake.exe use  PellesCDir enviroment variable for that $(PellesCDir)

INCLUDE = $(PellesCDir)\Include\Win;$(PellesCDir)\Include#
LIB = $(PellesCDir)\Lib\Win;$(PellesCDir)\Lib#

If that work insert that enviroment variable to your system


// // ~ •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •

Ok, here is the Povar32.bat file that works magic:

@echo off
set PellesCDir=C:\Program Files\PellesC
rem
echo Setting 32-bit environment for Pelles C...
rem
set PATH=%PellesCDir%\Bin;%PATH%
set INCLUDE=%PellesCDir%\Include;%PellesCDir%\Include\Win;%INCLUDE%
set LIB=%PellesCDir%\Lib;%PellesCDir%\Lib\Win;%LIB%

// // ~ •  •  •  •  •  •  •  •

   Ok all we are really doing is adding
C:\Program Files\PellesC\Bin to the beginning of the System Path environmental variable temporarily, while this console window session is open. [%PATH% on the end means you are adding this new path to the beginning of the variable string.]

Also, you are temporarily creating/adding the INCLUDE, and the LIB variables and PelleC paths.
Originally in my System variables I had no INCLUDE, or LIB variables so I created them and added the above paths.

// // ~ •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •
// // ~ •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •

OK, I have beat this subject to death !

I have now proved that two out of three of my System Variables are OK.

I found out that if you open a console window, then key in "set path", the output is the path as exists (System plus any current changes).
Keep it open and run povars32.bat, again key in "set path", you will see that the bat file added the "C:\Program Files\PellesC\bin" to the front end of the Path string.

(same thing with the set include and the set lib commands)

// // ~ •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •

  Here is my conclusion: Either something is goofy with my XP operating system OR pomake.exe somehow checks to see if
"C:\Program Files\PellesC\bin" was just added as a temporary path environmental variable.


  What makes me think this?

  Because in my System variables I have everything correct. I have "C:\Program Files\PellesC\bin" (no quotes) at the beginning of my Path variable (just like povars32.bat will do) if you run povars32.bat I see it added (temporarily) another (a second) "C:\Program Files\PellesC\bin" to the front of my path variable.

  Ok. Here is what I did .....

  Edit povarse32.bat and comment out all but:

set PellesCDir=C:\Program Files\PellesC
rem
echo Setting 32-bit environment for Pelles C...
rem
set PATH=%PellesCDir%\Bin;%PATH%

Open Console window in my folder with my .ppj file issue this command:

"C:\Program Files\PellesC\Bin\pomake.exe" -f "Determine String Lenght uses TCHAR hr integer on return GOLD.ppj"

It will not build.
Keep window open, run the new povars32.bat, then again:

"C:\Program Files\PellesC\Bin\pomake.exe" -f "Determine String Lenght uses TCHAR hr integer on return GOLD.ppj"

Guess what it builds.

So my going to System and adding the Include variable and paths and creating the LIB variable and adding the paths WORKED.

The only thing I am doing with the new povars32.bat file is adding another "C:\Program Files\PellesC\bin" to the front of the PATH variable string.

So I am at a dead end.
I will have to run my new, small povars32.bat prior to running pomake.exe every time.

It sure seems silly, but (assuming my system is not goofed up) if pomake.exe is checking to see if "C:\Program Files\PellesC\bin" was just added temporarily then I will just have to do it.

Bizarre.

Ok that's it for me on this subject !  Unless someday someone can figure it out or prove that my system must be goofed up.

Thanks guys.











Offline AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 394
    • Alex's Link Sammlung
Re: Trying to re-build project file at Command Line with Pomake.exe
« Reply #6 on: April 29, 2010, 09:13:47 AM »
If you want to Have Pelles C constantly availably, then you can (and here is my problem that I have a german Windows) add in the system setting - system, the enviroment variables for Pelles C.

The next you start cmd.exe, you will have all your new environment variables.
best regards
 Alex ;)

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: Trying to re-build project file at Command Line with Pomake.exe
« Reply #7 on: April 29, 2010, 10:02:57 AM »
Quote
@echo off
rem pomake.bat
SET PellesCDir=C:\Program Files\PellesC
"C:\Program Files\PellesC\bin\pomake.exe" -f "Determine String Lenght uses TCHAR hr integer on return GOLD.ppj"
pause

and ran the above, but it did not work.

If it doesn't work PellesCDir points wrong directory
or these lines are missing from  "Determine String Lenght uses TCHAR hr integer on return GOLD.ppj"

INCLUDE = $(PellesCDir)\Include\Win;$(PellesCDir)\Include#
LIB = $(PellesCDir)\Lib\Win;$(PellesCDir)\Lib#

Testing:
Code: [Select]
@echo off
rem pomake.bat
SET PellesCDir=C:\Program Files\PellesC
"C:\Program Files\PellesC\bin\pomake.exe" -f hello.ppj
pause
This was enought to make hello.ppj project in my WinXP SP3.

Quote
Now Timo, you have this (below), but I am aftaid I do not know what you want me to try !
Quote
pomake.exe use  PellesCDir environment variable for that $(PellesCDir)

INCLUDE = $(PellesCDir)\Include\Win;$(PellesCDir)\Include#
LIB = $(PellesCDir)\Lib\Win;$(PellesCDir)\Lib#

If that work insert that environment variable to your system
I try to explain how pomake.exe uses that environment/system variable PellesCDir in ppj-file.
Those INCLUDE and LIB are taken from there.
So PellesCDir environment variable should be enought to add your system if you use pomake.exe.
Those environment variables INCLUDE and LIB are needed for commandline usage.

Another hello.ppj test:
Code: [Select]
@echo off
rem pomake-hello.bat
SET PellesCDir=C:\Program Files\PellesC

echo Windows: %WINDIR%
echo PellesC: %PellesCDir%
echo INCLUDE: %INCLUDE%
echo LIB:     %LIB%
"%PellesCDir%\bin\pomake.exe" -f hello.ppj
pause
You can test that from Explorer just doubleclicking that bat-file
« Last Edit: April 29, 2010, 12:10:02 PM by timovjl »
May the source be with you

EdPellesC99

  • Guest
Re: Trying to re-build project file at Command Line with Pomake.exe
« Reply #8 on: April 29, 2010, 06:07:44 PM »
Alex,

 Yes, that is what I want to do.
Thanks, Ed

'' ~ •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •

Timo,
Quote
@echo off
rem pomake.bat
SET PellesCDir=C:\Program Files\PellesC
"C:\Program Files\PellesC\bin\pomake.exe" -f "Determine String Lenght uses TCHAR hr integer on return GOLD.ppj"
pause
///////////////////
If it doesn't work PellesCDir points wrong directory
or these lines are missing from  "Determine String Lenght uses TCHAR hr integer on return GOLD.ppj"
INCLUDE = $(PellesCDir)\Include\Win;$(PellesCDir)\Include#
LIB = $(PellesCDir)\Lib\Win;$(PellesCDir)\Lib#

I opened the .ppj file in my editor, and thought about the above,
and Oh my god I got what you were trying to do ..... and it explains everything, I tried it and proved it.

   Yesterday, when I tried your pomake (console window opened, and stayed open with the pause), I closed the window, then
 opened a new console window and entered:
"C:\Program Files\PellesC\bin\pomake.exe" -f "Determine String Lenght uses TCHAR hr integer on return GOLD.ppj"

   So no wonder it did not re-build!
   This morning when I edited my .ppj file I saw the lines
Quote
INCLUDE = $(PellesCDir)\Include\Win;$(PellesCDir)\Include#
LIB = $(PellesCDir)\Lib\Win;$(PellesCDir)\Lib#
   I then realized the .ppj file was using a variable called PellesCDir, and that you were defining it in your pomake.bat file,
and that you need (with the pause) to keep the console session going when you then pomake the .ppj file (in order to keep the variable PellesCDir defined) !

   Wow. The .ppj file NEEDS the PellesCDir variable !!!!!!!!!!!  You were right on track !!

   Ok NOW .....just to continue to respond .......


Quote
Another hello.ppj test:

Code:
@echo off
rem pomake-hello.bat
SET PellesCDir=C:\Program Files\PellesC

echo Windows: %WINDIR%
echo PellesC: %PellesCDir%
echo INCLUDE: %INCLUDE%
echo LIB:     %LIB%
"%PellesCDir%\bin\pomake.exe" -f hello.ppj
pause
You can test that from Explorer just doubleclicking that bat-file

 Ok when I run the above file, I get a message saying cannot find file hello.ppj

Output:
Quote

Windows: C:\WINDOWS
PellesC: C:\Program Files\PellesC
INCLUDE: C:\Program Files\PellesC\Include;C:\Program Files\PellesC\Include\Win
LIB:     C:\Program Files\PellesC\Lib;C:\Program Files\PellesC\Lib\Win
POMAKE: fatal error: File not found: 'C:\SGV1\C SafeString\Console\StringCchLenght\hello.ppj'.
Press any key to continue . . .
[\color]

'' ~ •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •

Ok back to:
   Wow. The .ppj file needs the PellesCDir variable !!!!!!!!!!!  You were right on track !!


So The only thing I must do is open a console session running, define the variable "PellesCDir", and in that same session
pomake the .ppj file.

Super Great Work Timo Thanks a lot !!!

So my Tool I now use in Edit Pad Pro is:
C:\Windows\system32\cmd.exe /c povars32Ed.cmd && pomake.exe -f "%FILENAMENOEXT%.ppj"

and the contents of povars32Ed.cmd is:
Code: [Select]
@echo off
set PellesCDir=C:\Program Files\PellesC

// // ~ •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •  •

  Ok I really understand. Thanks again Timo, and Also:

Thanks for "coming back" and banging on my hard head until I got it !!!!!!!!!


....... My new "Tool" works like a champ !!!! And I am not adding any temporary system environmental variables,
 as all paths are now in the System variables.



... Ed
« Last Edit: April 29, 2010, 09:41:22 PM by EdPellesC99 »

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: Trying to re-build project file at Command Line with Pomake.exe
« Reply #9 on: April 29, 2010, 07:00:17 PM »
If you have that environment variable PellesCDir defined you don't even need
that povars32Ed.cmd.

Try this if EPP supports environment variables:
Code: [Select]
"%PellesCDir%\bin\pomake.exe" -f "%FILENAMENOEXT%.ppj"else try this:
Code: [Select]
"c:\Program Files\PellesC\bin\pomake.exe" -f "%FILENAMENOEXT%.ppj"
May the source be with you

EdPellesC99

  • Guest
Re: Trying to re-build project file at Command Line with Pomake.exe
« Reply #10 on: April 30, 2010, 12:35:37 AM »
   Timo
   Well Timo, you completed the job totally !!!!

Quote

If you have that environment variable PellesCDir defined you don't even need
that povars32Ed.cmd.

................

else try this:

Code:
"c:\Program Files\PellesC\bin\pomake.exe" -f "%FILENAMENOEXT%.ppj"

'' ~ •  •  •  •  •  •  •  •  •  •  •  •
Ok to Summarize here are the final System Environmental variable changes.

[Start/Control Panel/Performance and Maintenence/System/Advanced tab/Environmental Variables.......]
Then modify System Variables.


To System Environmental Variables I made the following changes / additions:

To the front end of the Path Environmental variable string of Folder paths, I added:
C:\Program Files\PellesC\Bin;

I created an INCLUDE variable, and added following paths:
C:\Program Files\PellesC\Include;
C:\Program Files\PellesC\Include\Win;

I created a LIB variable, added following paths:
C:\Program Files\PellesC\Lib;
C:\Program Files\PellesC\Lib\Win;

I created a variable called "PellesCDir" (no quotes), and added the path:
C:\Program Files\PellesC
'' ~ •  •  •  •  •  •  •  •  •  •  •  •
I rebooted.

Quote

Now my "Tool" in Edit Pad Pro is:

pomake.exe -f "%FILENAMENOEXT%.ppj"
or
C:\WINDOWS\system32\cmd.exe /k pomake.exe -f "%FILENAMENOEXT%.ppj"


'' ~ •  •  •  •  •  •  •  •  •  •  •  •
   I use the first if I want console output within a message pane in EPP, .......OR if I wanted the console output
 to go to the console window, then I would use the second "Tool" version.

   Either way, works like a champ. Everything is in system now.

   Great, :) :) :) :) :) :)

   Thanks again Timo, you played a "Perfect Game".

   Much appreciated, I learned quite a bit about system variables here !!!!!

   Tx, Ed
« Last Edit: April 30, 2010, 12:51:37 AM by EdPellesC99 »