gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Why doesn't my makefile work?

#132474 - HyperHacker - Wed Jun 27, 2007 3:48 am

I'm trying to learn how to use makefiles, and I found a decent tutorial, but I cannot for the life of me comprehend this problem. Here is my makefile (the filename should just be "makefile" right?):
Code:
# Path to libnds
LIBNDS = F:\DOS\DevKitPro\libnds

PROGRAM = test
OPTIONS = -fomit-frame-pointer -ffast-math -fno-exceptions -fno-rtti
CXX = arm-eabi-g++
CXXFLAGS_7 = -g -mcpu=arm7tdmi -mtune=arm7tdmi -mthumb-interwork -I${LIBNDS}\include -DARM7 ${OPTIONS}
CXXFLAGS_9 = -g -mcpu=arm9tdmi -mtune=arm9tdmi -mthumb-interwork -I${LIBNDS}\include -DARM9 ${OPTIONS}

test: arm7.o arm9.o
   echo whee

arm7.o: arm7.c
#   ${CXX} ${CXXFLAGS_7} -c arm7.c -o arm7.o
   arm-eabi-g++ -g -mcpu=arm7tdmi -mtune=arm7tdmi -mthumb-interwork -IF:\DOS\DevKitPro\libnds\include -DARM7 -fomit-frame-pointer -ffast-math -fno-exceptions -fno-rtti -c arm7.c -o arm7.o
   
arm9.o: arm9.c
   ${CXX} ${CXXFLAGS_9} -c arm9.c -o arm9.o

   


And arm7.c:
Code:
#include <nds.h>

int main(int argc, char** argv)
{
   while(true);
}


arm9.c isn't important because it never gets there. >_> When I type "make" I get this:
Code:
arm-eabi-g++ -g -mcpu=arm7tdmi -mtune=arm7tdmi -mthumb-interwork -IF:\DOS\DevKitPro\libnds\include -DARM7 -fomit-frame-pointer -ffast-math -fno-exceptions -fno-rtti -c arm7.c -o arm7.o
arm7.c:1:17: error: nds.h: No such file or directory
make: *** [arm7.o] Error 1


Now the part that makes no sense at all is if I just run that command directly, it finds nds.h and compiles fine. So, uh, WTF? Why does it seem to ignore the -I parameter when called by make?
_________________
I'm a PSP hacker now, but I still <3 DS.

#132475 - chishm - Wed Jun 27, 2007 4:02 am

It could be due to the backslashes (\). Change them to forward slashes and change the F:\ to /f/. Then again, I may be completely wrong on this.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com

#132478 - HyperHacker - Wed Jun 27, 2007 4:23 am

Huh, it didn't work last time, but it did this time. Must have missed one. Thanks!

I'll probably have more questions soon though. :-p
_________________
I'm a PSP hacker now, but I still <3 DS.