Game Development Community

Proper makefile include path

by J. Alan Atherton · in Torque Game Engine · 03/14/2003 (11:11 am) · 2 replies

Being very new to the engine, I am struggling while trying to compile the ogg sound support. I am an experienced programmer, but I have never worked with makefiles as complicated as these. I don't use VC. I am using GCC3 with MingW and MSYS... so I need to edit the makefiles manually.

I think I found everything I need to add/change, but don't know the proper syntax. For the include path (which in the case of ogg is: torque/lib/oggvorbis/include ) I noticed there is a PATH.H.SYS variable in many makefiles. I found where it is used... just after a "-I." and "-I" is for the include path. The period after it disturbed me, since that's just including the current dir. I tried a few methods of typing in /lib/oggvorbis/include, but the compiler wouldn't even run. Then I just typed this into PATH.H.SYS: -I./lib/oggvorbis/include Or something very similar, and then some of the inclusion seemed to work. Many errors still came up at compile time, though, and I couldn't get it to fully work. It didn't even get to linking.

I also found the targets.torque.mk in torque/engine, and added the appropriate files there.

My big question is, where do I specify the include path? The configured makefile I use is: conf.GCC3.WIN32.mk with the Debug build.

I appreciate any help, and will be taking notes on all of my early struggles to eventually turn it into a resource/documentation.

- J. Alan Atherton

#1
03/14/2003 (11:32 am)
In targets.torque.mk, search for INCLUDES_BASE

You will see a list of include flags. Add your oggvorbis flags there.

-I../lib/oggvorbis/include

Note that ".." is used to specify the relative path to the include directory.

For linking, open conf.GCC3.WIN32.mk

In the LINK.LIBS.GENERAL, variable, add

-L../lib/oggvorbis/lib -logg -lvorbis

../lib/oggvorbis/lib may need to be changed to the directory that contains the libraries.

If this doesn't work, please report your exact error messages.
#2
03/15/2003 (12:19 am)
Ok, got everything to compile and link... it runs beautifully. Just thought I would note one hangup.

GCC complained about a "_G_config.h" file missing. I looked at where it was being included, and it is only included when the compiler is GNUC (well, when GNUC is defined). I searched everywhere in the mingw and msys folders, and sure enough the file was missing. Popped that filename into Google along with mingw (Click to do the search) and it found quite a few things. It looks like this file was packaged with earlier mingw versions that shipped with gcc 2.96. Now that gcc3 is packaged with it, this file doesn't seem to be included or something. I'm not sure of those details, I can only infer. On one of the many sites I looked at, they had the _G_config.h (specific for MinGW, as linux also uses this file) file to download, so I thought I'd give it a try. Sure enough, it worked.

Another question... the demo exe went up from 3.5megs to 27megs with these changes. Is this just from the ogg libraries? Is this normal? With a release build will this change?

- J. Alan Atherton