#138443 - Kiz - Fri Aug 24, 2007 5:28 am
Hi guys,
I've been reading some example code, and now I'm looking to try and port some of my OpenGL work to my DS (just for the sake of it). However, instead of editing my existing makefile and butchering the hell out of it with all the various devkitPro stuff that I've got no clue about, I figured I'd just build a new one around one of the example makefiles.
The thing is, I'm not that great with the advanced side of makefiles, so I got a bit lost trying to follow the logic in one of the example makefiles (eg: the one found at http://devkitpro.cvs.sourceforge.net/devkitpro/examples/nds/Graphics/3D/nehe/lesson05/ ). From what I can gather reading through it, it ignores .h files that are in the source directory. What exactly would I need to change so that it would recompile a respective .o file if the .h file has changed?
I *think* that I'd just have to add something like
HFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.h))) at line 71, then change the export OFILES (line 86) to also include $(HFILES:.h=.o)
Am I on the right track?
Also, the export VPATH (line 62) line makes it compile all source in subdirectories (and their subdirectories etc.) of the source directory, right?
Thanks in advance for the help, just trying to understand everything as well as I can before I start coding.
I've been reading some example code, and now I'm looking to try and port some of my OpenGL work to my DS (just for the sake of it). However, instead of editing my existing makefile and butchering the hell out of it with all the various devkitPro stuff that I've got no clue about, I figured I'd just build a new one around one of the example makefiles.
The thing is, I'm not that great with the advanced side of makefiles, so I got a bit lost trying to follow the logic in one of the example makefiles (eg: the one found at http://devkitpro.cvs.sourceforge.net/devkitpro/examples/nds/Graphics/3D/nehe/lesson05/ ). From what I can gather reading through it, it ignores .h files that are in the source directory. What exactly would I need to change so that it would recompile a respective .o file if the .h file has changed?
I *think* that I'd just have to add something like
HFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.h))) at line 71, then change the export OFILES (line 86) to also include $(HFILES:.h=.o)
Am I on the right track?
Also, the export VPATH (line 62) line makes it compile all source in subdirectories (and their subdirectories etc.) of the source directory, right?
Thanks in advance for the help, just trying to understand everything as well as I can before I start coding.