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 > makefile from examples: 1 CPU -> 2 CPU

#59700 - Volta - Thu Nov 03, 2005 4:17 pm

Hi!

I'm having hard time with the makefiles.

I'm using the makefile in one of the examples (say examples\graphics\2d\complex_2d). While very, very useful, I now need to use the arm7 processor.

This file will only compile and link to the arm9 processor. I tried to use the template project in the directory "examples\templates\combined" but its makefile is way too much different than the ones in the other examples.

I searched for a solution... My problem is that I can't use the makefile from the tutorial of Chris Double because I have some pictures in bin format and his makefile cannot link these files.

So... Anyone has made a makefile for compiling arm9 and arm7 sources while being able to link .bin pictures?

Thanks!

#59710 - wintermute - Thu Nov 03, 2005 5:52 pm

There are 3 makefiles in the combined template, one at the top level and one for each of the processors. Look at the makefile in the arm9 directory, it has a variable for data directories.

Code:

#---------------------------------------------------------------------------------
# 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
# DATA is a list of directories containing binary files
# all directories are relative to this makefile
#---------------------------------------------------------------------------------
BUILD      :=   build
SOURCES      :=   source 
INCLUDES   :=   include
DATA      :=


later in the makefile you'll find the rule for .bin


Code:

#---------------------------------------------------------------------------------
# you need a rule like this for each extension you use as binary data
#---------------------------------------------------------------------------------
%.bin.o   :   %.bin
#---------------------------------------------------------------------------------
   @echo $(notdir $<)
   @$(bin2o)


simply repeat this rule for each extension you wish to use as binary data

#59713 - Volta - Thu Nov 03, 2005 6:05 pm

!!

I never noticed that the makefile in the 2 directories were different.

I just added the directory name for the DATA var and it worked perfectly. Thanks! :)