Hi,
Every time I modify the contents of a bitmap in the game data, I also need to "touch" or modify the resource.rc file. If I don't, the bitmap don't get converted to binary and integrated into the rom. Is it possible to fix the make file so that not only it checks the resource.rc but also assets like bitmaps?
I've got a work around where I manually "touch" the resource file at every build, but I wonder if there's something more efficient possible.
Thanks!
DJCC
resource.rc
Moderator: Stef
-
- Very interested
- Posts: 2994
- Joined: Fri Aug 17, 2007 9:33 pm
-
- Very interested
- Posts: 710
- Joined: Sat Feb 18, 2012 2:44 am
At the moment, my needs are at the "no big deal" point. So my workaround is currently fine.Chilly Willy wrote:The simplest thing is to clean the project each time. For smaller projects, that's no big deal. Just "make clean" before making the project. For BIG projects that take an hour to compile, you'd want to read up on dependencies in make scripts.
I'd argue that the current behavior is a kind of bug. The files referred to in the resource.rc should be checked for modifications as well.
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
The SGDK makefile is intended to be as much generic as possible but because of that the dependencies are definitely wrong.
I guess you use a specific directory to put your resources attached to the resource.rc file so the default SGDK makefile does not directly convert your bitmap files to binary.
What i can do is to reserve a specific directory for genres resources (genres could be a good name) so the resource.rc file take care of the dependencies in this specific folder. Do you think that is a suitable solution ?
I guess you use a specific directory to put your resources attached to the resource.rc file so the default SGDK makefile does not directly convert your bitmap files to binary.
What i can do is to reserve a specific directory for genres resources (genres could be a good name) so the resource.rc file take care of the dependencies in this specific folder. Do you think that is a suitable solution ?
-
- Very interested
- Posts: 629
- Joined: Thu Nov 30, 2006 6:30 am
-
- Very interested
- Posts: 710
- Joined: Sat Feb 18, 2012 2:44 am
-
- Very interested
- Posts: 629
- Joined: Thu Nov 30, 2006 6:30 am
For C, you can get the compiler do it for you with certain flags (-M and friends in gcc). For resource.rc, either genres would need to be modified to support a similar feature or a little script would need to be written to parse the rc file and spit out dependencies. from my limited understanding of the format, it looks like it could easily be done in sed or awk, though it doesn't look like those tools are currently included with sgdk. I suppose you could grab them from MinGW though.Stef wrote:Generating dependencies this way mean you have to parse resource.rc file (or C files for include dependencies) O_o ??
You don't need to modify the makefile (well not on the fly anyway). You just add an include command. make will silently ignore missing include files if you put a minus sign in front of the command.Stef wrote:Anyway the problem in my case is how to locally modify the makefile ? i want to keep the generic makefile.gen as it is.
So for instance in a C++ project at work, I do something like the following (assume that OBJS has a list of target object files):
Code: Select all
DEPS=$(OBJS:.o=.d)
%.o: %.cpp:
$(CPP) -c $(CFLAGS) -MMD -MP -MF"$(@:.o=.d)" -MT"$@" -o $@ $<
-include ($DEPS)
The result is a bunch of .d files in makefile format get spit out in the build output folder and these get included with the -include in the bottom of the makefile.