Pelles C forum

C language => Beginner questions => Topic started by: PhilG57 on June 06, 2012, 04:20:23 PM

Title: How to use POMAKE?
Post by: PhilG57 on June 06, 2012, 04:20:23 PM
I have to admit I don't know how to use POMAKE.  I know the ".ppj" file changes when I make changes within the workspace or project, but it is difficult to correlate these changes to ".ppj" changes.  I understand the ".ppj" is pretty much a text file with embedded make commands, but I don't know how to access or edit that file directly.  Thanks. 

Title: Re: How to use POMAKE?
Post by: CommonTater on June 06, 2012, 04:26:23 PM
I have to admit I don't know how to use POMAKE.  I know the ".ppj" file changes when I make changes within the workspace or project, but it is difficult to correlate these changes to ".ppj" changes.  I understand the ".ppj" is pretty much a text file with embedded make commands, but I don't know how to access or edit that file directly.  Thanks. 

Pelles Project files are plain text, you can open them with notepad.  BUT ... be warned... unless you know exactly what you are doing it is far easier to screw up your project than it is to fix it.

As with most things in Pelles C, your best information source for POMAKE is the help file... 
Help -> Contents -> Command line tools -> POMAKE

Title: Re: How to use POMAKE?
Post by: PhilG57 on June 06, 2012, 04:31:23 PM
Thanks, but the help file 'General description' says "...when POMAKE starts....".  How do I invoke POMAKE directly, preferably from within the overall workspace and/or project?  Do I have to invoke it directly much as I do for the complete IDE environment?  Thanks again. 
Title: Re: How to use POMAKE?
Post by: CommonTater on June 06, 2012, 05:16:11 PM
These are command line tools... They have no GUI.  You can't simply click on them; you have to execute them from a command shell (http://www.bleepingcomputer.com/tutorials/windows-command-prompt-introduction/)  ...  once you have a command shell open in your project's directory you would type (for example) pomake /F myproject.ppj and press enter...
 
Why don't you tell us exactly what you're trying to do...
Maybe more information will bring better answers.
 
 
Title: Re: How to use POMAKE?
Post by: PhilG57 on June 06, 2012, 05:34:25 PM
Thanks again.  I'm not much for 'good ol' command line programs, especially in a WIN32 environment, but I'll give it a try later on.  I suspect it will work as you specify.

I'm messing around with static and dynamic linked versions of the same program; I'm not certain how to specify that difference under the IDE umbrella and thought jumping into make might be easier.  For example, it looks as if I want to specify an additional ".lib" or ".obj" files for link editing, I include those file names in the appropriate project options (Link) section.  But then, the IDE could not find my files....

I'll be away from the computer for a couple of days and will report back.  Thanks again. 
Title: Re: How to use POMAKE?
Post by: CommonTater on June 06, 2012, 06:02:12 PM
I'm messing around with static and dynamic linked versions of the same program; I'm not certain how to specify that difference under the IDE umbrella and thought jumping into make might be easier.

If you mean static vs dynamic linking to a C Runtime Library that is controled at  ...

Project -> Project Options -> Compiler -> Runtime Library

.. just set the option to "Multithreaded DLL" to link to an external CRT library.


If you mean putting your code in a DLL as opposed to a Static LIB... well that's a bit more complex.  The two are different enough that you'd probably be smartest to create one of each...

Quote
For example, it looks as if I want to specify an additional ".lib" or ".obj" files for link editing, I include those file names in the appropriate project options (Link) section.  But then, the IDE could not find my files....
Did you add their paths to the Folders list?

Project -> Project Options -> Folders -> Libraries
Project -> Project Options -> Folders -> Includes
Title: Re: How to use POMAKE?
Post by: AlexN on June 06, 2012, 09:50:13 PM
I have to admit I don't know how to use POMAKE.  I know the ".ppj" file changes when I make changes within the workspace or project, but it is difficult to correlate these changes to ".ppj" changes.  I understand the ".ppj" is pretty much a text file with embedded make commands, but I don't know how to access or edit that file directly.  Thanks.
Why do you want to edit or change something in the ppj file. All you need can be done with the IDE and if you start build the project, poide starts build the project by using the ppj file.
Title: Re: How to use POMAKE?
Post by: CommonTater on June 06, 2012, 11:01:01 PM
Why do you want to edit or change something in the ppj file. All you need can be done with the IDE and if you start build the project, poide starts build the project by using the ppj file.

Hi Alex...
 
FWIW, I quite often make manual edits in PPJ files.  They don't always move as nicely as we'd like, sometimes they get relative paths wrong, and then there's the eternal version# fix problem....

However; I'm wondering just what our friend is up against...
Is he making a proper project before starting?
Is he experiencing difficulty integrating files?
etc.


Title: Re: How to use POMAKE?
Post by: frankie on June 07, 2012, 09:57:43 AM
POMAKE works more or less like MAKE (you can look to the make manual from GNU).
Some predefined variables have different symbols, you can find them in the help file (in it are reported only the differences from standard make).
Title: Re: How to use POMAKE?
Post by: PhilG57 on June 11, 2012, 04:21:05 AM
Hi, I'm back and will test out sometime tomorrow some of these suggestions .  Many thanks for all the good ideas; here are some answers to the queries above....

I always let the IDE create the .ppj and other files.  In this case, I have multiple projects within a workspace and the workspace is now set up well.  FYI, I did notice that when creating additional projects (File->New->Project) the IDE always created the new .ppj in a sub-directory of where the .ppw file lived.  I had to move the newly created ,ppj and .ppx files to the main directory and then used the iDE to add projects to the workspace.  Then, of course, I added code modules to the project.

My desire is eventually to have two versions of this program: one linked static (all the modules together) and one with some code modules separate in my own separate DLL.

My interest in POMAKE is akin to that of the old Unix or GNU make; I'd like to have my one workspace, with multiple projects, and to be able to tell the IDE to make one version or the other.  Something like: POMAKE myprogram static or POMAKE myprogram dll.

My next task is to play with POMAKE using the command line interface to see what flexibility and strengths it brings.

Thanks again to all for the suggestions and help. 
Title: Re: How to use POMAKE?
Post by: CommonTater on June 11, 2012, 08:34:19 AM
My interest in POMAKE is akin to that of the old Unix or GNU make; I'd like to have my one workspace, with multiple projects, and to be able to tell the IDE to make one version or the other.  Something like: POMAKE myprogram static or POMAKE myprogram dll.

Actually what you're describing is something you can do directly from the IDE...
 
Install the Workspace Editor  (http://forum.pellesc.de/index.php?topic=3721.msg13822#msg13822)AddIn So you can create a workspace (.ppw) file independently of the New Project wizard. 
 
Create the root folder for your workspace by hand.
 
Select File->New->Project... in the wizard at the bottom select the workspace folder in the Location bar... then create your first project by typing it's name...
 
Follow on this by creating your other projects... editing the paths etc. as necessary.
 
Now click File -> Edit Workspace Files ... from there you can add your projects to your own custom workspace and save the file anyplace you like.  (I'm assuming you will want to use the base workspace folder)...
 
To open your custom workspace... just double click it in explorer and let POIDE open it by file association.  Or you can use File-> Open and select it there.
 
Now you can add files to your projects... keep in mind that projects can share the same source files, even if it builds them differently (Take a look at the source code for the workspace editor... you'll see what I mean)

To build any of your projects just select Project -> Build or click the Build button on the IDE's toolbar.  To rebuild, select Project -> Rebuild.  Project -> Rebuild Workspace will rebuild everything in one pass.
 
Easy stuff...
 
 
 
 
 
Title: Re: How to use POMAKE?
Post by: PhilG57 on June 19, 2012, 12:24:32 PM
Sorry for the delayed response; during the summer I'm often away from the computer for several days in a row...

1) I tried using POMAKE via the command line interface but it was not successful.  I'm an old mainframe, DOS, and Unix person who seems to have gotten too comfortable with the GUI...

2) I downloaded and installed the Workspace Editor but it did not run on my 4.5 version of Pelles fine compiler.  Unfortunately, I have no plans to upgrade to a more current release as v4.5 is super fast with all the features I think I need.

3) I've fiddled around with the IDE, creating numerous projects of various types and believe I can kludge up a workable process to accomplish what I want.   I did mis-step and create several projects of the wrong type (Win32 vs. console or 'lib'); is there any way to change the type of project once it has been created and has had files added to it?

4) Also, is there any way to tell the IDE I just want a program compiled and not linked nor made into a 'lib' entry?  I realize I can just add the source module to a project and compile it with another module.  But I would like to have a project separate from any of the others which is 'compile only' project.  Later I'll want to include those object files in a link edit of a bunch of files.

Thanks.
   
Title: Re: How to use POMAKE?
Post by: CommonTater on June 19, 2012, 01:35:16 PM
1) I tried using POMAKE via the command line interface but it was not successful.  I'm an old mainframe, DOS, and Unix person who seems to have gotten too comfortable with the GUI...

Don't sweat it... I've been using Pelle's C for a long time and I've never used POMAKE yet... the IDE's always done what I've asked of it. There should be no reason to "go legacy" there's no added power or features for doing it.

Quote
2) I downloaded and installed the Workspace Editor but it did not run on my 4.5 version of Pelles fine compiler.  Unfortunately, I have no plans to upgrade to a more current release as v4.5 is super fast with all the features I think I need.

Whew... 4.5 is pretty old... What OS is this running on?
 
I would strongly suggest you update to at least 6.0... the new 7.0 would be better.
 
Quote
3) I've fiddled around with the IDE, creating numerous projects of various types and believe I can kludge up a workable process to accomplish what I want.   I did mis-step and create several projects of the wrong type (Win32 vs. console or 'lib'); is there any way to change the type of project once it has been created and has had files added to it?

Not easily... In POIDE large parts of it's behaviour are controlled by the POC_PROJECT_TYPE macro, if you try changing it, it's likely to cause more problems than it solves.  Your simplest way out would be to delete the .PPJ file and create a new one, then add your source files to it. (Shouldn't take more than a couple of minutes.)
 
Quote
4) Also, is there any way to tell the IDE I just want a program compiled and not linked nor made into a 'lib' entry?  I realize I can just add the source module to a project and compile it with another module.  But I would like to have a project separate from any of the others which is 'compile only' project.  Later I'll want to include those object files in a link edit of a bunch of files.

Sure, that's easy... just click the compile button on the toolbar.  Sweep your mouse slowly along the toolbar and you'll see what each button does in a pop-up tooltip.  Alternatively you can use the compile function from the Project menu.
 
Phil... it would really help if you'd tell us what you're trying to do with all this... I'm pretty sure most of us just fire up the IDE, write some code, build and go; there's not a lot of chatter about he command line toolchain (which is used by the IDE) at all.  For you to be messing with this as you are I'd have to postulate either a wildly complex task or something of a wrong turn...
 
Title: Re: How to use POMAKE?
Post by: migf1 on June 19, 2012, 05:19:33 PM
Based on the fact that you said you are a MSDOS, Unix kind of guy, you may consider working with gnu-make. I'm successfully using this for a long time, through the MinGW bintools.

Assuming you are familiar with make/gnu-make you may either create different makefiles for each task you are aiming to, or you can have just one makefile and pass them parameters through its command-line. There's nothing stopping you to use the Pelles C compiler/assembler/linker/etc specific tools within the makefile.

Most of them can also be done with pomake, but if you are more familiar with make/gnu-make it may be more easy for you ;)

Title: Re: How to use POMAKE?
Post by: PhilG57 on June 19, 2012, 10:09:17 PM
Thanks again for the suggestions and advice...

1) I'm running WinXP with no plans to 'upgrade' to a newer version of the OS.  I know XP is no longer supported but my hardware platform is pretty stable.  Also, I load lots of programs and tools and they all seem to work well with XP. 
2) Some time ago, I tried a later version of Pelles C (maybe 5.0) and thought it slow.  Since I really don't need any of the newer compiler features (focused on desktop apps), I'm happy with 4.5.
3) I understand I can compile only individual files; I was hoping for a way to easily compile (only) a bunch of files which are packaged into a project.  I was hoping for a magic setting in the project file to indicate 'compile only'.
4) Thanks for suggestion gnu-make but I'm trying to stay within the boundaries of the Pelles IDE.  And with GUI based tools.
5) I am working on a large, complicated, and very old MSDOS / Unix project which I hope to convert to Windows.  Naturally it is now a "console" program so I'm using the IDE to get it working in that state.  Eventually, I'll convert it to a "Win32" program with all the attendant changes.  There are many source files and the finished result has an option to create both a static and dynamic linked versions of the programs.  There are also 'lib' files plus other additional files to be compiled and linked with some of the routines.  I've been reviewing an old make file trying to figure out what modules are linked with the 'lib' files and which have to have several source modules all linked together.  It's a fun, learning project, which I hope to be able to use with my later programming efforts.  I have a workspace with 19 projects, sharing the same source files, and which seems to satisfy most of the various compile and link edit configurations.

Thanks again.       
Title: Re: How to use POMAKE?
Post by: TimoVJL on June 19, 2012, 10:53:33 PM
Quote
3) I understand I can compile only individual files; I was hoping for a way to easily compile (only) a bunch of files which are packaged into a project.  I was hoping for a magic setting in the project file to indicate 'compile only'.
create static library project and insert to AR flag -? in project options -> Macros tab ARFLAGS.
Then it shows only help without doing anything else.
Title: Re: How to use POMAKE?
Post by: migf1 on June 19, 2012, 11:30:26 PM
Thanks again for the suggestions and advice...
...
2) Some time ago, I tried a later version of Pelles C (maybe 5.0) and thought it slow.  Since I really don't need any of the newer compiler features (focused on desktop apps), I'm happy with 4.5.
3) I understand I can compile only individual files; I was hoping for a way to easily compile (only) a bunch of files which are packaged into a project.  I was hoping for a magic setting in the project file to indicate 'compile only'.

I'm not sure what you mean, but invoking pocc cc without any with the command-line flag /c sounds like doing what you are asking for.

For example...

Code: [Select]
cc /c foo1.c foo2.c foo3.c

will produce only the object files foo1.obj, foo2.obj and foo3.obj without doing anything else (it will just compile them).

Quote
4) Thanks for suggestion gnu-make but I'm trying to stay within the boundaries of the Pelles IDE.  And with GUI based tools.
5) I am working on a large, complicated, and very old MSDOS / Unix project which I hope to convert to Windows.  Naturally it is now a "console" program so I'm using the IDE to get it working in that state.  Eventually, I'll convert it to a "Win32" program with all the attendant changes.  There are many source files and the finished result has an option to create both a static and dynamic linked versions of the programs.  There are also 'lib' files plus other additional files to be compiled and linked with some of the routines.  I've been reviewing an old make file trying to figure out what modules are linked with the 'lib' files and which have to have several source modules all linked together.  It's a fun, learning project, which I hope to be able to use with my later programming efforts.  I have a workspace with 19 projects, sharing the same source files, and which seems to satisfy most of the various compile and link edit configurations.

Thanks again.     

I honestly believe you're making things harder than they should be. From what you have described so far it seems so much easier to build your targets from the command line, by using either pomake or gnu-make (chances are you won't even need gnu-make).

After all, IDEs do nothing more than providing a camouflage for the command-line tools. Even not taking advantage of all their features. In the case of pomake, for example, the IDE is documented to provide partial support of pomake's full potential...

Quote
POMAKE reference

Pelles make utility is used for building projects from the command line. POMAKE uses the same file format as the IDE. The make file may use either OEM, UTF-8, or UTF-16LE encoding (from version 5.0).


The IDE only support a subset of the POMAKE syntax, for example no preprocessor directives.
...

EDIT:

Replaced pocc with cc (I left the original text striked-through)
Title: Re: How to use POMAKE?
Post by: CommonTater on June 20, 2012, 04:07:30 AM
Hello again Phil...
A couple of points if I may.

1) XP is a fine OS probably the best Microsoft has ever produced.  It'll be around for quite a while yet and most hardware manufacturers still issue XP drivers, so no worries about the OS... I was wondering, given your mention of MS-DOS if perhaps we were talking about Win95 or such, in which case you'd be basically screwed for doing anything useful.

2) I use the 7.0 compiler on XP every day, no worries.  Yes it is a bit slower building projects but the result is also a far better Executable than 4.5 created.  The code is far more optimal and often smaller than the 4.5 code... also the new C-11 standard has a whole mess of very nice new bells and whistles that I'm already starting to use as a matter of course.

3) Sorry ... no compile only flag.  But then, nobody really makes much use of OBJ files directly anymore.  When libaries of accumulated function calls are needed we almost always use either .LIB or .DLL libraries rather than .OBJs... Also modern compilers are smart.  If you compile a source page the OBJ file sits in the Output folder and will not be recompiled unless you change the source.  When linking to EXE DLL or LIB targets any up to date objs be used as is.

5) Sounds like a lot of work to me :D  One thing you should know is that Console proggies do not convert to GUI projects with any ease at all.  The two operating scenarios are so totally different that you almost always end up doing a full re-write to cross the gulf between them.  The reason for this is that Console programs tend to be single tasking and most sit and wait for user input where Windows programs are event driven, relying upon a message gueue and "tosser" for their behaviours.  Such totally different operating concepts do not translate at all well...

I don't mean to discourage you, but you should know what you're up against...  Go take a look at TheForger's Windows API (http://www.winprog.org/tutorial/) tutorial.  As you scan through the code samples and lessons you will initially find yourself wondering what language you're looking at... Yes it's C... but it ain't nothing like most people are used to in console environments.
 
Title: Re: How to use POMAKE?
Post by: PhilG57 on June 20, 2012, 02:56:51 PM
Thanks again to all for their thoughts and comments.

Microsoft sold over 400 million copies of XP and I figure if my programs work on XP, they should easily work on Win Vista, Win 7, etc. with no problem.  Yes, I understand that philosophy precludes, with both the OS and the IDE, being able to take advantage of the latest and greatest features.

I do like very much the Pelles IDE as it is fast and easy to use.  I'm going to stay strictly with GUI tools and thanks to the suggestions in this thread, have learned some more about how to make it do what I want it to.

This old program supposedly ran on DOS, Win95, WinNT, and Unix but I have no way to test that capability.  I'm well aware of the differences between Windows and earlier programs and the effort required to convert it to an event based system.  This old program, for all its complexity, has pretty simple functionality.  So right now, I'm toying with creating a Windows "shell" which will call the various modules of the old program based on user menu choices.  Then later on, I can convert the whole thing to a 'real' Windows program.

But I'm ahead of myself.  So for now, I'll continue to plug away.  Probably later on, I'll have more questions for all you forum members.  Many thanks to all for helping...
Title: Re: How to use POMAKE?
Post by: CommonTater on June 20, 2012, 03:27:44 PM
No worries Phil... always glad to spout an opinion :D

Title: Re: How to use POMAKE?
Post by: Bitbeisser on June 20, 2012, 04:58:58 PM
Thanks again to all for their thoughts and comments.

Microsoft sold over 400 million copies of XP and I figure if my programs work on XP, they should easily work on Win Vista, Win 7, etc. with no problem. 
And along comes Windows 8...  :-[

Ralf  ;)