Steves Yaroze Page.
"Anything is possible, even Impossible sais "I'm possible".


Back
Up

Using GCC Makefiles in

wpe3.jpg (17922 bytes)

Having completely given up trying to use the very apptly named 'Code Warrior' (I fought all this weekend with the bloody thing (and lost!)  ), I decided to use my faithfull old development tool.  Don't get too excited,  this won't mean instant C++ code from probably the best development tool in the world.  What it will mean is that you can use the superb editing and manoverability of Developer Studio and use the 'Make/GCC' tool for seamless compiling and linking.  Read on and I'll show you how.

This integration is based on the presumtion that you're using NT.  It shouldn't be much different if you're using 95, but I couldn't be bothered booting to it and trying it out. (let me know the outcome when you try it, and I'll post it here).

The first thing to do is to set the 'DJGPP' environment variable in  'control panel/system/environment'.

wpe4.jpg (33841 bytes)

Obviously, change the e:/psx/psx to wherever it is on your machine, bearing in mind that the 'forward slash' is mandatory.

Now... You need to set the gnu 'bin' directory in Dev Studio.  Click 'tools/options/directories/executable files'.  Sorry to all those who tried and failed because I was stupid enough to leave this out.

wpe3.jpg (20170 bytes)

Once you've done this, the next step is to open the 'Makefile' in Developer Studio.  This step is easy.  Select 'Open Workspace', change the file type to 'All Files' and select the 'makefile'

wpe5.jpg (20829 bytes)

You're then greeted with

wpe6.jpg (14304 bytes)

After clicking Yes, select the Win32 platform.  Remember, you're only using Developer Studio for editing and navigation, so the Win32 bit is irrelevant anyway.

wpe7.jpg (6600 bytes)(Don't worry about the Win32 bit)

Now you've got the makefile all nicely 'wrapped up', it's time to expose the bits you'll be using developer studio for, the files.  Select 'Project/Add to project/Files' from the menu.  Add as many files as you like.

Now we come to configuring the build bit.  Select 'project/settings from the menu', and type in what you see below.

wpe9.jpg (24876 bytes)

The build command line specifies that we wan't to use 'make' using the default 'makefile'.  The Rebuild all options say we want to use 'make clean'.   Now in Developer studio, we can clean our project using 'Project/Rebuild All', and then build it using 'project/build makefile.exe'.  Note that the '.exe' is not built by Developer Studio.  The output files created are exactly the same as if you typed 'make' on the command line.

That's it.  You can now whizz around Developer Studio, using it's lovely editor and workspace windows, change, and build you're code in next to no time.

Adding files to the Developer Studio Project does not reflect any changes to the original 'makefile'. 

If you add files to the project using Developer Studio, it's a piece of cake to open up the '.dsp' file as text (select 'File/Open', 'Open As-Text') and copy bits of the 'Source' section back into your original makefile.  For instance, I've added 'anotherfile.cpp' using Developer Studio.  I then opened the project file (.dsp) as text and rummidged through looking for bits to cut and paste into the makefile.  Here is the section from my .dsp file

# Begin Source File

SOURCE=".\another file.cpp"			This is the one we want !
# End Source File
# Begin Source File

SOURCE=.\MAIN.C
# End Source File
# Begin Source File

SOURCE=.\MAKEFILE
# End Source File
# Begin Source File

SOURCE=.\PAD.C
# End Source File
# Begin Source File

SOURCE=.\PAD.H
# End Source File
# End Target
# End Project
I hope this helps those of you with Developer Studio.  I remember seeing an article on integrating 'Javac' into VC++ 4.x some time ago (before the invention of VJ++).   This was an excellent article (unlike this one), that described how to use 'Javac' in VC.  It even went on to describe how to get VC to display the line of code that any errors were found on.  If anyone remembers this and knows it's whereabouts, please let me know.

 

If you've got any comment/suggestions/hard cash relating to this article, please drop me a line.

Home

 


Visit my other home-page

ICQ:14349918

Sign My Guestbook   View My Guestbook
Guestbook by GuestWorld
Last updated 9th August 1998.   This page has been visited Times