Detecting source files in other folders

support for the powerpc toolchain
Post Reply
diego_pmc
Posts: 1
Joined: Sun Nov 08, 2009 2:56 pm

Detecting source files in other folders

Post by diego_pmc » Sun Nov 08, 2009 3:17 pm

Hello, I'm using the latest version, r19, and I am having some problems on compilation.
I want to use GRRLIB and I decided it would be better if instead of installing it in the compiler's include folder, I would just keep the only functions I need in my project and store the source of GRRLIB in the same place as the rest of my source code.

So my file tree looks like this:
  • Risen.pnproj
  • Makefile
  • sources
    • main.cpp
    • config.h
    • config.cpp
    • (etc.)
    • GRRLIB
      • grrlib.h
      • GRRLIB_render.c
      • (etc.)
When I try to compile it tells me that I have undefined references to the GRRLIB functions I am using, which I guess means it cannot find the source files where they are defined. But if I move all the header and source files of GRRLIB in the "sources" folder, these problems disappear.

Could someone please help me with this? Here's my project. I currently have two GRRLIB functions at the beginning main(); they are there for testing, I do not intend to leave them there. Also "gfx" folder and its contents are from Sand Traps, also for testing.

User avatar
vuurrobin
Posts: 219
Joined: Fri Jul 11, 2008 8:49 pm
Location: The Netherlands
Contact:

Re: Detecting source files in other folders

Post by vuurrobin » Sun Nov 08, 2009 5:34 pm

you need to add sources/GRRLIB to the source and include path in the makefile.

pretty much on top of the makefile is this:

Code: Select all

#---------------------------------------------------------------------------------
# TARGET is the name of the output. For it to be the directory name, write $(notdir $(CURDIR))
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# INCLUDES is a list of directories containing extra header files
#---------------------------------------------------------------------------------
TARGET		:=	boot
BUILD		:=	build
SOURCES		:=	source
DATA		:=	data  
INCLUDES	:=

add sources/GRRLIB to the SOURCES and INCLUDES variable.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests